Replace comment about glib 2.22 with version check

GLib has macros to check for versions, so we might as well use them.

Note that I haven't actually compiled/checked to make sure that this commit actually works with glib 2.22+; linerva doesn't have that new of a glib.