Check the error return of flush_write_file().