mm-video: vidc: defer flush until headers are consumed

In case flush arrives while codec-config buffers are sent
to codec, defer sending flush till codec config buffers
are consumed. This fixes CTS tests which issue flush
right after configure(i.e after queueing headers).

Change-Id: I8cfcaecacc79da8d2c75a521b2a616a20aa69099
mm-video-v4l2: vidc: move flush waiting logic to appropriate place

If a flush arrives while codec-config buffers are in the ETB queue,
both flush and ETB are sent to the video driver which can cause
corruption in output frames. Move flush waiting logic so that flush
is deferred until the headers are consumed

Change-Id: Id0647bfc749ac7e4af975530ac82210cc93023f2
CRs-Fixed: 703100