Handle dns failure error. Test in freedom https://github.com/freedomjs/freedom/pull/123
fix #31
Merge pull request #37 from freedomjs/connectfailures

Handle dns failure error.