Switch socket from non-blocking mode before synchronous write.

Using socket.sendall() with socket in non-blocking mode leads to EAGAIN.
Up default timeout for synchronous operations to 2 sec. It is necessary
to upload large applications (test on 640Mb archive) with cocaine-tool.