g_type_init got deprecated, fix compile.

Why can't the GTK folks just leave us alone?
Some people use development versions of glib ...
Remove use of deprecated static threads api since glib v2.32.
Removed additional deprecated static mutex. Also added mutex
initialization due statically allocated mutex are not backward
compatible with older versions of glib.