Deal with reading a buffer less than what was allocated.

With this fix, file_long_read now passes.
Yep, I applied further changes. Even better solution would be to explicitly return unsigned value and define error value symbolically, but as nobody proposes that, let's stay close to posix quirks ;-).