wlan: Don't allow rmmod when SSR is in progress

There is a race condtion during rmmod exit func where driver wait
to acquire rtnl_lock and in case of active thread inside driver,
it waits for long. In between if SSR occurs we set SSR variable
and wait for any active to exit from driver. When active thread
exits both SSR and rmmod exit function are executed in parallel
causing undefined behaviour.
Now acquiring rtnl_lock before checking for logpinProgress i.e
if SSR is in prgress.

Change-Id: I3a76572dceb47ce587d9d4794a8ba27b6a1b19b4
CRs-Fixed: 812422
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index 2b10f95..2d8a6f5 100755
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -10192,6 +10192,12 @@
    }
    else
    {
+      /* We wait for active entry threads to exit from driver
+       * by waiting until rtnl_lock is available.
+       */
+      rtnl_lock();
+      rtnl_unlock();
+
       INIT_COMPLETION(pHddCtx->ssr_comp_var);
       if ((pHddCtx->isLogpInProgress) && (FALSE ==
                   vos_is_wlan_in_badState(VOS_MODULE_ID_HDD, NULL)))
@@ -10208,10 +10214,8 @@
          }
       }
 
-      rtnl_lock();
       pHddCtx->isLoadUnloadInProgress = WLAN_HDD_UNLOAD_IN_PROGRESS;
       vos_set_load_unload_in_progress(VOS_MODULE_ID_VOSS, TRUE);
-      rtnl_unlock();
 
        /* Driver Need to send country code 00 in below condition
         * 1) If gCountryCodePriority is set to 1; and last country