gtk: replace deprecated call to GLib functions through GObject

GObject used to expose part of the GLib API, but since PyGObject 3.7.2,
this is now deprecated and will be eventually gone one day.

See 483c86 from the PyGObject Git repository from
git://git.gnome.org/pygobject