read-file: Avoid memory reallocations with regular files.