Fix getaddrinfo() memory leak

See antirez/redis#2012 for the leak causing unbounded memory growth.

This leak was fixed in the Redis anet.c version of network code, but since the hiredis version is essentially the same code copy/paste'd (which came first?), we need to apply the fix here too.