fileio-label: return error when writing fails

The status of actually writing the file was totally ignored.