Make the "synchronous" mode actually work without race conditions.

There were many issues with synchronous mode that we discovered when started to try and add a "batch" mode. There was a race condition where the event handling thread might consume events when in sync mode and other times the Process::WaitForProcessToStop() would consume them. This also led to places where the Process IO handler might or might not get popped when it needed to be.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@220254 91177308-0d34-0410-b5e6-96231b3b80d8