When glib is built static, the threads and clock code are not initialized since DllMain is never run. Instead, initialize them from the glib constructor. https://bugzilla.gnome.org/show_bug.cgi?id=678387