Backport tcp_connect method for sockets.

+ fix socket:readline regexp.