Adding condition-variable-based command queue implementation

Reused code from my project https://code.google.com/p/libbbuf/