Resume partial writev's

Handle partial writes as suggested here:

http://stackoverflow.com/questions/5853675/techniques-for-handling-short-reads-writes-with-scatter-gather