Add connection timeout.
Add connection timeout.

We can't use a general socket timeout because of our use of buffered
socket I/O with socket.makefile(), but we can add a timeout to the
part where we connect to the server, and remove the timeout once the
connection succeeds.

seveas/beanstalkc,earl/beanstalkc,yetone/beanstalkc,bcho/beanstalkc