qcacld-3.0: Fix 2nd STA failed to connect in dbs mode

When STA connect and target AP isn't in scan cache, specific
scan for AP ssid will happen, and roam profile is saved in
scan info.
When scan complete, in registered csr scan callback, if connect
need HW mode change, HW mode change is sent to F/W, and roam
profile in scan info is freed at once.
In HW mode change response handler,  if roam profile in scan info
is found to be freed,  failed to start connect.

Fix:
Make sure roam profile not freed before issue connect.
In specific scan result callback, before issue connect, check
whether need HW mode change.
1. If HW mode change is unneeded or return FAILED, free roam
   profile in scan info.
2. If HW mode change return SUCCESS,  when cmd is finished or
   cancelled, in csr_free_cmd_memory, free roam profile when
   cmd is e_sme_command_set_hw_mode with reason
   POLICY_MGR_UPDATE_REASON_HIDDEN_STA.

Change-Id: I3f87996de4142baea33dd0f56cb2a892f0387336
CRs-Fixed: 2369154
2 files changed