proxy: Attempt to reconnect on connection errors

This modifies the proxy dial command to retry to retry if it hits an
error. Previously it would pass a timeout, but not retry if there
is a connection error of some sort. It also adds a similar retry
for the listening socket.
Is this part in response to a real problem?  I get the desire to retry a dial, but a listen?  Why?