use-after-free fixes (xdg_shell popups, primary selection source, xwm parents)
see individual commits:
- popups and their parent surface (happens with submenus in konsole)
- primary selection (happens when overwriting selection in e.g. urxvt)
- xwm parents/children (happens when closing gimp)