only use clean buffer for failed write if sent something

Signed-off-by: Andy Green <andy.green@linaro.org>