Node.js client: add error & timeout handling

- Unless I deeply mis-undestand things, there is no error & timeout
  handling before this commit, but for IE.  This changes fixes things at
  least for Node.js.