Fail xdg_surface creation when surface has role
If a given wl_surface already has a role (e.g. cursor or subsurface), there is nothing you can do with an xdg_surface which won't raise an error, apart from destroying it.
The xdg-shell spec does not specifically flag this as illegal, however Mutter does already implement this behaviour. Creating an xdg_toplevel or an xdg_popup from a surface which already has a role is definitively illegal, which we already catch.
cf. wayland-protocols!92 (merged)
The first commit in this MR just moves an extant error check earlier, because it makes our lives easier.