clients: A better fix for a crash when unlocking or unconfining a pointer
This is a rewrite of the fix in: https://lists.freedesktop.org/archives/wayland-devel/2018-May/038140.html
It addresses Pekka's concerns about window getting destroyed before the unlock/unconfine event is triggered.
Signed-off-by: Dima Ryazanov dima@gmail.com