net: fix buffer iteration in bytesWritten

Pretty stupid, but happens.

/cc @isaacs