Encapsulate the raw socket.send calls

SSL supports needs to do a set of error checking on each send. In
anticipation of that work, pull the socket calls into a single method so
that the error checking and retries can be put into the same place.

Change-Id: I9be82c511d3cb63b94104e7896a1b1396a704507
Merge "Encapsulate the raw socket.send calls"