Use GPrivate instead of GStaticPrivate

Because GStaticPrivate was deprecated since GLib 2.32.
Add backward compatible GMutex API

Because dynamic GMutex allocation API was deprecated since GLib 2.32.
GLib >= 2.32 provides g_mutex_new() and g_mutex_free() as deprecated
API but they are not used because they showes deprecated messages at
compile time.