Fix dealloc for Python 3