When ibs is smaller than obs, checking the block count in the outer
loop is not sufficient; we need to break out of the inner read loop
once we've read the specified number of blocks.
Thanks to phoebos for reporting this issue.
ipos is always ahead of opos, so the left side of this condition
was never true. This only mattered when we get short writes, since
on EOF we always have less than a full output block, so it takes
only one normal write.