Fix usage of getaddrinfo()