Fix #580: Catch exceptions that escape JS test framework in test bridge