Correctly handle allocation failures in evdns_getaddrinfo

Kuldeep Gupta appears to have used some kind of automated tool to
find this and generate a patch for half the issue as #149.