Deal with reading a buffer less than what was allocated.

With this fix, file_long_read now passes.
And just because the read function only returns -1 doesn't make the out_sz < 0 incorrect (it still detects exactly all of the same error conditions). It's still just as correct as out_sz == -1. The out_sz < 0 is more robust.

If you feel that it should be changed back, then we need to add another if around the for loop that checks for out_size > 0 (since that code will only work properly when out_sz is in fact > 0). It is incorrect to call the for loop with out_sz <= 0.