Work around bad native code

Don't crash managed app when native code crashes during cleanup.