BL-697: Improve handling of JavaScript errors

The C# call stack at this point is just:
_jsCallHook_JavaScriptError()
unmanaged code
Application.Run()