shell: Make sure we still have touch or pointer focus when moving/resizing

It's possible to touch a surface to move it and let go before we get
to common_surface_move(), in which case we don't have a touch focus
when we get there.  For pointers, we could click a surface, but have the
surface go away before we get to common_surface_move(), in which
case the button count is non-zero, but we don't have a surface.

In either case we crash, so let's add a check to make sure we still
have a focus surface before we try to move it.

Closes: https://bugs.freedesktop.org/show_bug.cgi?id=73448
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index 00c7b01..c82c00f 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -1469,6 +1469,7 @@
 	struct weston_surface *surface;
 
 	if (seat->pointer &&
+	    seat->pointer->focus &&
 	    seat->pointer->button_count > 0 &&
 	    seat->pointer->grab_serial == serial) {
 		surface = weston_surface_get_main_surface(seat->pointer->focus->surface);
@@ -1476,6 +1477,7 @@
 		    (surface_move(shsurf, seat) < 0))
 			wl_resource_post_no_memory(resource);
 	} else if (seat->touch &&
+		   seat->touch->focus &&
 		   seat->touch->grab_serial == serial) {
 		surface = weston_surface_get_main_surface(seat->touch->focus->surface);
 		if ((surface == shsurf->surface) && 
@@ -1656,10 +1658,13 @@
 	if (shsurf->state.fullscreen)
 		return;
 
-	surface = weston_surface_get_main_surface(seat->pointer->focus->surface);
 	if (seat->pointer->button_count == 0 ||
 	    seat->pointer->grab_serial != serial ||
-	    surface != shsurf->surface)
+	    seat->pointer->focus == NULL)
+		return;
+
+	surface = weston_surface_get_main_surface(seat->pointer->focus->surface);
+	if (surface != shsurf->surface)
 		return;
 
 	if (surface_resize(shsurf, seat, edges) < 0)