Deal with reading a buffer less than what was allocated.

With this fix, file_long_read now passes.
This change is not correct. stream_p->read() is returning -1, and only -1, in case of error. Any other value is non-error. This is in turn based on sensible interpretation of POSIX read(), which accepts size_t as input. So, mentioned sensible interpretation is that return value is positive, except for singe special value of -1, and the reason why return value given ssize_t type is only to streamline checking for that special value.