Add mutex support for commands