fix deadbuf issue when flushing an outgoing batch