Don't fail on incomplete reads and writes

Read or write on a file can read or write only a part of the supplied buffer in some cases (for example, if the file is a pipe). Make eeprom_import and eeprom_export work in those cases too.