Dispose of all allocated memory on native library unload