IO#read will return `nil` on EOF

Fixes https://github.com/github/github/issues/33845

cc @charliesome