Replace use of deprecated GThread API

Also remove the call to g_type_init(), which is deprecated and no longer
needed since glib 2.36. The thread functions have been deprecated in
glib 2.32. We therefore raise the required glib version to 2.36.