Remove use of deprecated g_type_class_add_private function
The g_type_class_add_private function and G_TYPE_INSTANCE_GET_PRIVATE macro are deprecated. Replace with the G_DEFINE_TYPE_PRIVATE and G_ADD_PRIVATE macros, and *_get_instance_private functions.
These macros were introduced in glib version 2.38 so this requires increasing the minimum glib version.
Issue #1023