tests: Fix memory leaks in getaddrinfo test