trace: correct variable name in write() error message