Adding DESTROY back in with a HASH ref check
Created by: andrewyatz
The previous attempt at this did not do a HASH ref check. We need to do this because there is an XS object in the same namespace as these two objects. It is a little confusing but this seems to be okay. The main thing is we do the check and we know we're working with the Perl object and can issue the close() to cleanup the objects.