COMPAT: free parser memory at close() for non-refcnt gc
relying on ``__dealloc__`` to clean up ``malloc()``ed memory can lead to a perceived "leak" on PyPy since the garbage collector will not necessarily collect the object as soon as its ``refcnt`` reaches 0. 

Instead, pre-emptively release memory when ``close()`` is called

The code still maintains backward compatibility for the case where ``close()`` is never called