Set socket buffers before establishing TCP connection

The window scale option carried in SYN segment is computed from socket's
receive buffer size. So we need to set this buffer size before calling
connect or bind.
Merge pull request #600 from hurtonm/master

Set socket buffers before establishing TCP connection