Add fix for emscripten on exit