codec2: fix SimpleC2Component race condition

- Fix race condition around stop/reset/release.
- Call onFlush at processing thread.

Bug: 74073134
Test: adb shell setprop debug.stagefright.ccodec yes
Test: adb shell setprop debug.stagefright.omx_default_rank 1000
Test: adb shell killall mediaserver
Test: atest android.media.cts.MediaCodecTest
Change-Id: I74c2d84c35842907c1f7f6e862d37b748409a73f
(cherry picked from commit e3534403fa6666408fd419fc9809b3efbfa94479)
2 files changed