This is a binding-friendly version of g_dbus_connection_register_object. Based on a patch by Martin Pitt and the code of g_bus_watch_name_with_closures. https://bugzilla.gnome.org/show_bug.cgi?id=656325