Fix race condition in thread creation am: 30099479aa

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/av/+/19680305

Change-Id: I34a4df1de4bb085dbb09cf86caa0242a170f21e4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>