fix for connection errors

this commit calls back early on connection errors so we don't
get more uncaught exceptions.
Merge pull request #7 from segmentio/fix/error

fix for connection errors