Fix race condition in Android camera JNI code.

AndroidVideoCapturerJni dtor is called on signaling thread
and may destroy JNI global refs while processing late camera
frame arrival in ReturnBuffer_w() in worker thread.

Fix this by waiting for all function invoked on worker thread
to complete in camera JNI dtor.

R=wzh@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/49099004

Cr-Commit-Position: refs/heads/master@{#9037}
2 files changed