Doh - 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.
Merge pull request #85 from rhc54/cmr/iof-output

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