Refine lock sequence lock-wait-unlock/lock-signal-unlock
Yeah, we don't need to spawn thread for each instance
Make sure that cmd and module_id are correct
Add tracing
Fix rate condition

The race condition or dead lock in this case occured approx 1 time out of 15000 messages.
The problem is when the thread isn't yet waiting for the condition variable inside the loop, but
the condition is signaled in dsi_recv_or_grab the waiting blocks forever until the next signal
comes, which shouldn't happen under normal condition
Guard against possible spurious wakeups
Disable DEBUG