Reset buffer on write error.