Fix bug caused by assuming socket sends always send the full buffer.

Using ab, with 100 requests, 2 concurrently, on a 2 vCPU VM, 30-40
requests fail reliably. Traced the problem to socket Send()s by the
recservice to the web app not always sending the full buffer in one
call. The documentation for the Send() is misleading. On Linux,
apparently some conditions can cause Send() to report sending
fewer bytes than requested.
Move sending socket options until after connecting.

There is possibly a mono bug where setting socket options in a
TCPClient before the connect has no effect.