Update to new fd and wl_registry APIs

This commit updates the clients and the wayland compositor backend to
use the new wl_registry mechanism and the thread safe fd API.
diff --git a/clients/editor.c b/clients/editor.c
index ce0692f..02ee5da 100644
--- a/clients/editor.c
+++ b/clients/editor.c
@@ -835,14 +835,15 @@
 }
 
 static void
-global_handler(struct wl_display *display, uint32_t id,
+global_handler(struct display *display, uint32_t name,
 	       const char *interface, uint32_t version, void *data)
 {
 	struct editor *editor = data;
 
 	if (!strcmp(interface, "text_model_factory")) {
-		editor->text_model_factory = wl_display_bind(display, id,
-							     &text_model_factory_interface);
+		editor->text_model_factory =
+			display_bind(display, name,
+				     &text_model_factory_interface, 1);
 	}
 }
 
@@ -856,9 +857,9 @@
 		fprintf(stderr, "failed to create display: %m\n");
 		return -1;
 	}
-	wl_display_add_global_listener(display_get_display(editor.display),
-				       global_handler, &editor);
 
+	display_set_user_data(editor.display, &editor);
+	display_set_global_handler(editor.display, global_handler);
 
 	editor.window = window_create(editor.display);
 	editor.widget = frame_create(editor.window, &editor);