Connect to "grab-notify" and "grab-broken-event" and close the popup when the grab is lost. (cherry picked from commit 2a984ef5)