compositor: keep track of the weston_layer a weston_view is in

This introduces a new struct, weston_layer_entry, which is now used
in place of wl_list to keep the link for the layer list in weston_view
and the head of the list in weston_layer.
weston_layer_entry also has a weston_layer*, which points to the layer
the view is in or, in the case the entry it's the head of the list, to
the layer itself.
diff --git a/src/input.c b/src/input.c
index 2c799f4..4aa8ca7 100644
--- a/src/input.c
+++ b/src/input.c
@@ -1555,8 +1555,8 @@
 	empty_region(&es->input);
 
 	if (!weston_surface_is_mapped(es)) {
-		wl_list_insert(&es->compositor->cursor_layer.view_list,
-			       &pointer->sprite->layer_link);
+		weston_layer_entry_insert(&es->compositor->cursor_layer.view_list,
+					  &pointer->sprite->layer_link);
 		weston_view_update_transform(pointer->sprite);
 	}
 }