Fix crash issue arising out of multiple hdmi connect/disconnects

Acquire mExtLock before proceeding further in
hwc_prepare_external to prevent crashes arising out
of updating ctx variables from two different
threads(composition and uevent threads)

Change-Id: I0f18c41b117f18aeb25572b53ef6eba3638bb826
diff --git a/libhwcomposer/hwc_uevents.cpp b/libhwcomposer/hwc_uevents.cpp
index eb525a6..b314317 100644
--- a/libhwcomposer/hwc_uevents.cpp
+++ b/libhwcomposer/hwc_uevents.cpp
@@ -148,7 +148,7 @@
                 }else if(!strncmp(s1,"wfd",strlen(s1))) {
                     ctx->mExtDisplay->teardownWFDDisplay();
                 }
-                Locker::Autolock _l(ctx->mExtSetLock);
+                Locker::Autolock _l(ctx->mExtLock);
                 clear(ctx, dpy);
                 ALOGD("%s sending hotplug: connected = %d and dpy:%d",
                       __FUNCTION__, connected, dpy);
@@ -170,7 +170,7 @@
                         // teardown Active WFD Display
                         ctx->mExtDisplay->teardownWFDDisplay();
                         {
-                            Locker::Autolock _l(ctx->mExtSetLock);
+                            Locker::Autolock _l(ctx->mExtLock);
                             clear(ctx, dpy);
                             //send hotplug disconnect event
                             ALOGD_IF(UEVENT_DEBUG, "sending hotplug: disconnect"
@@ -195,7 +195,7 @@
                 ALOGD("%s sending hotplug: connected = %d", __FUNCTION__,
                         connected);
                 ctx->dpyAttr[dpy].connected = true;
-                Locker::Autolock _l(ctx->mExtSetLock); //hwc comp could be on
+                Locker::Autolock _l(ctx->mExtLock); //hwc comp could be on
                 ctx->proc->hotplug(ctx->proc, dpy, connected);
                 break;
             }