r18001: Proper error reporting on write/close fail.