qcacmn: Additional checks for moving command to active queue

The current implementation was not checking for pending
queue status before adding command to pending queue.

This was causing an issue, when,  after removal of an active
command, we were preepmted and a new request came, it made
it to the active queue. Now when the previous thread resumed,
and we attempted to move pending to active, it failed.

Added the following new checks:

1. When adding command to active queue, make sure there is no
commands in the pending queue

2. When moving from pending to active, make sure it is allowed
to add commands to the active queue.

Change-Id: Ief16c22f6f7e2cdc105e24f164e5891bfe806662
CRs-Fixed: 2356719
5 files changed