wayland/xdg-shell: Move popup role assignment behind checks
If we returned early in one of the checks but already assigned the surface role, we'd later run into a double-free and crash. Just do the checks at the beginning.
Also, the check introduced in commit 88ff196f missed a return
.