Fix SEGFAULT with older Glib versions

* Conditionalized the call to g_type_init() so that it's called on older
  versions and the program doesn't crash.