dtvrecorder: Flush the payload buffer whenever a new payload starts.

We start buffering at the beginning of each payload, and don't write out the
data until we know if this payload has a keyframe.  This is so a new file
(for back to back recordings) would start on a keyframe.

Further, the keyframe offset recorded in the DB, is the offset to the
beginning of the payload with the keyframe.  Or at least it was supposed to
be.  Since we were not actually flushing any data currently in the buffer at
the start of a payload, that offset could be pointing to a completely
different payload!

Fixes #11435