[#521782] unreliable file.read() error handling
(file_read): Clear errors before leaving the loop in all situations,
and also check if some data was read before exiting the loop with an
Document that sometimes a read() operation can return less data than
what the user asked, if running in non-blocking mode.
Document the fix.