io: remove unused parameter from the error cb
io: fix indentation
io: handle EOF when buffering properly