Don't crash with glib >= 2.41

More info [here](https://bugzilla.gnome.org/show_bug.cgi?id=735428#c14).