Simplify client TCP write.

Use the same patch as in the server.