Proper freeing of addrinfo