Replace debugger condition variable with semaphore.

There was a possible race condition where API callers may have been able to
call DebugStep multiple times, but the debugger would not react to each call. By
using a semaphore, each call will be handled regardless of how quickly any step
completes.

This also has a nice side effect of decreasing total lines of code.