This extracts the addressinfo part of makesock() into the new
makesock_addrinfo(). Hence makesock() becomes a simple function
which first calls lookup_address(), then makesock_addrinfo().
The two helper functions lookup_address() and makesock_addrinfo()
can be made public once there is a need for them.