Work around deprecated thread API in glib master