Handle clearing a large running commands backlog

Bug: 974319
Change-Id: Id1b30fd24d70560d1f0cce51a786659dee9dbd68
Merge "Handle clearing a large running commands backlog" into release-0.13