ffmpeg-extractor: Fix deadlock when stopping the reader thread
ffmpeg-extractor: Fix deadlock when stopping the reader thread

You cannot hold the lock used by the reader thread when trying
to join to the reader thread!

For example, if we start and then stop the reader thread
before it gets a chance to execute, one thread will be in
stopReaderThread calling pthread_thread_join (and holding mLock).
Then the reader thread will execute and immediately block on
mLock (it gets the lock immediately on startup).

Instead, release the lock while we wait for the thread to exit
and then reacquire the lock.

Change-Id: I9247ae48586c18f4eb7a4f74e188b9d4f88824e2

BrokenROM/external_stagefright-plugins,XPerience-AOSP-Lollipop/android_external_stagefright-plugins,TeamExodus/external_stagefright-plugins,AOSP-YU/platform_external_stagefright-plugins,Infinitive-OS/platform_external_stagefright-plugins,TeamExodus/external_stagefright-plugins,AOSPB/external_stagefright-plugins,SlimRoms/android_external_stagefright-plugins,XPerience-AOSP-Lollipop/android_external_stagefright-plugins,PAC-ROM/android_external_stagefright-plugins,Evervolv/android_external_stagefright-plugins,VRToxin/android_external_stagefright-plugins,YUPlayGodDev/platform_external_stagefright-plugins,AOSP-CAF/platform_external_stagefright-plugins,Infinitive-OS/platform_external_stagefright-plugins,YUPlayGodDev/platform_external_stagefright-plugins,F-AOSP/platform_external_stagefright-plugins,PAC-ROM/android_external_stagefright-plugins,Yu-AndroidM/android_external_stagefright-plugins,VRToxin/android_external_stagefright-plugins,AOSP-YU/platform_external_stagefright-plugins,Yu-AndroidM/android_external_stagefright-plugins,DirtyUnicorns/android_external_stagefright-plugins,AOSPB/external_stagefright-plugins,BrokenROM/external_stagefright-plugins,F-AOSP/platform_external_stagefright-plugins,DirtyUnicorns/android_external_stagefright-plugins,Evervolv/android_external_stagefright-plugins,AOSP-CAF/platform_external_stagefright-plugins,SlimRoms/android_external_stagefright-plugins