libweston-desktop/xdg-shell: Properly properly handle ack_configure

commit 749637a8a306588964885fe6b25fda6087a84ccd
introduced this feature, but the break is outside of any conditional
so only the first item in the list is ever tested.

If a client skips a few configures and then acks the most recent
it's still operating within spec, so the break should only occur
when a match is found.

This version also adds a break after we miss the target, as a tiny
optimization (the list will be cleaned up on disconnect anyway),
as it makes the code no more difficult to read or maintain.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
diff --git a/libweston-desktop/xdg-shell-v5.c b/libweston-desktop/xdg-shell-v5.c
index 77d004e..dd36086 100644
--- a/libweston-desktop/xdg-shell-v5.c
+++ b/libweston-desktop/xdg-shell-v5.c
@@ -481,8 +481,10 @@
 		} else if (configure->serial == serial) {
 			wl_list_remove(&configure->link);
 			found = true;
+			break;
+		} else {
+			break;
 		}
-		break;
 	}
 	if (!found) {
 		struct weston_desktop_client *client =
diff --git a/libweston-desktop/xdg-shell-v6.c b/libweston-desktop/xdg-shell-v6.c
index 1344dda..10274e0 100644
--- a/libweston-desktop/xdg-shell-v6.c
+++ b/libweston-desktop/xdg-shell-v6.c
@@ -1106,8 +1106,10 @@
 		} else if (configure->serial == serial) {
 			wl_list_remove(&configure->link);
 			found = true;
+			break;
+		} else {
+			break;
 		}
-		break;
 	}
 	if (!found) {
 		struct weston_desktop_client *client =