Update to new GLib thread API