Sys_ext: better errors for read_file and write_file.