wayland: close popups upon window activation
Popups should grab all input on Wayland, however there are numerous (deliberate) ways to get outside the grab, such as a shortcut that opens a new window or pressing alt-tab.
If a popup is active when the focus changes we are left in a state where the new window visibly has focus and appears on top of the popup's main window, but the popup is still visible with an input grab. This is a broken state.
This patch cancels popups if the focus window changes for whatever reason.
Cancelling a popup also destroys the window server side rather than waiting for the client to handle the popupDone so there is no racey aspect for the next input.