Fix crash when rapid firing command line commands

Change-Id: I0caaa51720fe3608b8c4cb02f046afb3cbaa54f9