Hopefully finally fix reset_counter behavior

This should eliminate the stale records that previously appeared in
outputs started directly after a flush. The flush behavior is now
much more thorough and the interfaces should be a bit easier to
comprehend.