Make sure world marked unloaded before unload event completes