test writeBuffer isn't cleared onError, removed 'closing' check in .flush()