debuggerd_handler: actually wait for pseudothread to exit.

Occasionally, the pseudothread wouldn't exit in time after unlocking
the mutex to get crash_dump to proceed, resulting in spurious error
messages. Instead of using a mutex to emulate pthread_join, just
implement it correctly.

Bug: http://b/34472671
Test: debuggerd_test
Change-Id: I5c2658a84e9407ed8cc0ef2ad0fb648c388b7ad1
(cherry picked from commit b64dd85c94ee21684d4ccbb0683d628eb1eb6121)
1 file changed