fix spurious undefined behavior in getaddrinfo