Only call g_type_init on GLib before 2.36

G_type_init was deprecated in GLib 2.36 and yields a compiler warning if
used. Add preprocessor checks around it to maintain compatibility with
versions of GLib prior to 2.36.

Signed-off-by: Marcus Karlsson <mk@acc.umu.se>