gobject: Split GObject serialization code
gobject: Split GObject serialization code

Like for the deserialization of a GObject into a JsonObject we
should split out the serialization of a GObject into a JsonObject
part of json_serialize_gobject() into its own private function.

robtaylor/json-glib-gvariant,frida/json-glib,Distrotech/json-glib,oerdnj/json-glib,brauliobo/json-glib,ebassi/json-glib,robtaylor/json-glib-gvariant,ebassi/json-glib,GNOME/json-glib,brauliobo/json-glib,oerdnj/json-glib,GNOME/json-glib,frida/json-glib,brauliobo/json-glib,ebassi/json-glib,Distrotech/json-glib,oerdnj/json-glib,oerdnj/json-glib,Distrotech/json-glib