ReaderUtil::each_byte shouldn't include EOF byte -- Issue #5056

Took a patch by @martine, and fixed a tests: replaced with_str_reader with file_reader, because with_str_reader seems not to reveal the problem.