handle all getaddrinfo results in echo_client

Previously the echo client called getaddrinfo and assumed
that the first result would work, otherwise it would quit.
This has been changed to iterate through all the results
until one is found that works.