freeaddrinfo: rewrite as iterative