libevtr: handle eof properly