Build: Command: Fix random deadlock

I still don't know exactly what happened, but by removing the
synchronized keyword from the method declaration, and adding the locks
manually, the access time will go down, and the deadlock situation no
longer happens.

Sure .... That's the way to solve problems (next time I promise I'll
figure out what was wrong).

Signed-off-by: Bart Kuivenhoven <bemkuivenhoven@gmail.com>