Fix thread safety in AudioRecordingConfigurationTest

MyAudioRecordingCallback is accessed from different threads
but was not using any synchronization, changed to use
CountDownLatch. Note that "record" sleeps are still needed
in tests doing recording. However, use of CountDownLatch
guarantees that the observer thread will see modifications
done on the callback handler thread.

Bug: 123312504
Test: android.media.cts.AudioRecordingConfigurationTest
      AudioRecordTest#testAudioRecordInfoCallback
      MediaRecorderTest#testAudioRecordInfoCallback
Change-Id: Ib39d703319850e1a1e3a6285f1e5218833a5e98f
3 files changed