perf util: Fix do_read() to fail on EOF instead of busy-looping