Handle dns failure error.

Test in https://github.com/freedomjs/freedom/pull/123

fix #31