command: fix leak when executing commands