wlan: Do not send cfg80211_scan_done at unload time

qcacld-2.0 to prima propagation.

As a part of NETDEV_GOING_DOWN, host try to abort the
scan but time out (Fwr was in bad state) happens hence
cfg80211_scan_done was not invoked.
Since kernel 3.14, Kernel complete the pending scan on
NETDEV_DOWN event, hence it is freeing the scan request.
During driver unload, Driver release the command and
invoke the callback.Hence cfg80211_scan_done will be
invoked. But the scan req was freed by kernel earlier,
Which lead to BUG_ON on NULL wiphy in kernel.

Change-Id: Ie5f0a562a6f591fa6e5ae9084f03cf3b7b526e91
CRs-Fixed: 872270
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index c024e0c..bf1b673 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -12595,11 +12595,13 @@
 
     /* Get the Scan Req */
     req = pAdapter->request;
+    pAdapter->request = NULL;
 
-    if (!req)
+    if (!req || req->wiphy == NULL)
     {
         hddLog(VOS_TRACE_LEVEL_ERROR, "request is became NULL");
         pScanInfo->mScanPending = VOS_FALSE;
+        complete(&pScanInfo->abortscan_event_var);
         goto allow_suspend;
     }
 
@@ -12636,7 +12638,12 @@
     {
          aborted = true;
     }
-    cfg80211_scan_done(req, aborted);
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
+    if (!pHddCtx->isUnloadInProgress)
+#endif
+        cfg80211_scan_done(req, aborted);
+
     complete(&pScanInfo->abortscan_event_var);
 
     if ((pHddCtx->cfg_ini->enableMacSpoofing == MAC_ADDR_SPOOFING_FW_HOST_ENABLE