lib/std: handle read errors in FileReader