Add a workaround to an Emscripten bug(?) that can leak exceptions past a catch(...) block.