generator: Avoid multiple buffer allocations
generator: Avoid multiple buffer allocations

Instead share a single GString in all
dump functions.

https://bugzilla.gnome.org/show_bug.cgi?id=773504

frida/json-glib,frida/json-glib