media: fix race condition around release

Protect native context for MediaCodec object from concurrent access.

Bug: 112863346
Bug: 112913410
Test: atest frameworks/av/media/libstagefright:postsubmit
Change-Id: Icacdd45bd6dcb0b03e2760a3441d2e7c7587d3ec
2 files changed