Convert to new Glib thread API