Do not leak info of destroy notify
Fix crash with type checking invalid GObject arguments

Ensure we have a valid GObject before attempting to call g_type_is_a.
Swap conditional blocks to make if condition more readable.

https://bugzilla.gnome.org/show_bug.cgi?id=727604
release 3.12.1