shell: grab the parent popup when a sub popup window is deleted or hidden

If the client opens a popup menu and submenu, when it closes or hides the
submenu the pointer grab should return to the parent menu.
Furthermore, when clicking outside the client area the popup_done event
is sent to the active popup surface and recursively to its parent.