wlan: In monitor mode release power_on_lock

During WLAN driver loading, irrespective of driver-mode, it acquires
power_on_lock and the same needs to be released during unload. But
in monitor mode power_on_lock is not released during unload. This may
lead SSR failure(assuming driver unloaded from monitor mode and then
loaded in machine mode) because during SSR process, platform driver
get stuck as it tries to acquire power_on_lock while processing
PROXY_VOTE(6) event(as same lock is not released by driver when its
loaded in monitor mode)
Hence in monitor mode release power_on_lock before driver unload is
done.

Change-Id: I2a4bc96611abd9f531d3c6a7318a681d2c6b0db4
CRs-Fixed: 903878
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index 95a7e2b..396f651 100755
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -8456,11 +8456,11 @@
 {
     VOS_STATUS vosStatus;
     v_CONTEXT_t pVosContext = pHddCtx->pvosContext;
-    struct wiphy *wiphy = pHddCtx->wiphy;
     long ret;
     hdd_mon_ctx_t *pMonCtx = NULL;
     v_U32_t magic;
     struct completion cmpVar;
+
     hdd_adapter_t *pAdapter = hdd_get_adapter(pHddCtx,WLAN_HDD_MONITOR);
     if(pAdapter == NULL || pVosContext == NULL)
     {
@@ -8517,15 +8517,7 @@
        nl_srv_exit();
    #endif
 
-   if (pHddCtx->cfg_ini)
-   {
-       kfree(pHddCtx->cfg_ini);
-       pHddCtx->cfg_ini= NULL;
-   }
    hdd_close_all_adapters( pHddCtx );
-
-   wiphy_free(wiphy) ;
-
 }
 /**---------------------------------------------------------------------------
 
@@ -8556,7 +8548,7 @@
    {
       hddLog(VOS_TRACE_LEVEL_ERROR,"%s: MONITOR MODE",__func__);
       wlan_hdd_mon_close(pHddCtx);
-      return;
+      goto free_hdd_ctx;
    }
    else if (VOS_FTM_MODE != hdd_get_conparam())
    {