[Debugging.Client] Add a racy fix for a race condition

This code is not particularly threadsafe, but null checking the local
field before locking it is probably no worse than what's already there.