qcacld-3.0: Prevent stainfo against double detach

Currently there is no way to know if an stainfo is
already detached and driver can detach stainfo
again which may lead to put sta ref count twice in
some race condition.

In current scenario SAP receives the deauth from station,
disconnects the station and puts the sta reference taken
against station attach.
In parallel to the deauth from station if SAP gets the
disconnect from user space, it gets the sta reference
and moves ahead with the disconnect process, in this
process again does detach and does the put sta ref
taken as part of the sta attach, in this way it puts the
sta info twice.

To address above issue add logic to check if stainfo is
already detached or not, if sta info is not already
detached, detach the sta info and do the put ref.

Change-Id: I00c75c4d850931fb2a347d740002c21fae50785a
CRs-Fixed: 2735151
5 files changed