debugger: Fix GCond usage

g_cond_wait() and the likes unlock the passed in mutex during the wait
and re-lock it before returning.  However, the code here used to pass
in an unlocked mutex.

This used to work because GLib threading implementation was tolerant
and allowed unlocking an unlocked mutex, but GLib 2.42 has a new and
less tolerant implementation that would abort in such situation.

Fix this by properly locking the passed in mutex.

The implementation here also removes the second mutex only used for the
condition as the one used to protect the loop body can very well be
used and actually makes sense as they protect the same thing.

Doing so requires to properly wait for the thread to quit before
destroying the mutex, but this probably should be done anyways to avoid
forcefully killing the thread when the application quits.
Merge pull request #156 from b4n/debugger/cond-usage-fix

debugger: Fix GCond usage