Refactor socket.tcp_connect() function

This patch fixes logic of non-blocking tcp connect as it
described in man pages and Unix Network Programming vol.1.
Set default value for socket:shutdown(how) argument to SHUT_RDWR