If we can't output an entire block, then we need to adjust the number of bytes

...remaining to be output or else we will output duplicate bytes when next we are able to write.

Cherry-pick of ompi-master:
open-mpi/ompi@8c837d3cb34e0d871dde0e13b734f96ce1e52dc3

@jsquyres please review this trivial fix