Fixed %unrefobject for inherited classes

Fixes the "unref" feature when used on derived classes with non-public
destructors.
I'm not sure if this is the correct method to be used, but this causes
the swig wrapper to check for a parent that supports the unref feature.