Conditionally call g_type_class_add_private()

Otherwise we end up calling it twice with GLib ≥ 2.38.

Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>