Fix deprecation warnings with GLib 2.36.