Improvements to send/recv

Previously there were error paths which would result in a lost context
and there were interleavings when two threads were working on the same
Connection where their outputs would interleave incorrectly