client, repl: use the correct window.onerror args

Amazingly, the `err` Error instance is NOT passed to the `onerror` callback.
See: https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers.onerror