Check for connection errors in javascript polyglot tests (#724)