replace dlclose() with CloseNativeLibrary() in vulkan layer

With its 2nd argument, the CloseNativeLibrary() can close
a library opened by either dlopen() or OpenNativeLibrary().
Thus, this change covers the native case missed when the
dlclose() was directly called.

Test: [CTS] run cts -m CtsGpuToolsHostTestCases -a armeabi-v7a

Change-Id: Id81e8042292cd95f0be18abdd53e3e62ed448f8e
Signed-off-by: Jacky.Deng <jacky.deng@intel.com>
Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
diff --git a/vulkan/libvulkan/layers_extensions.cpp b/vulkan/libvulkan/layers_extensions.cpp
index 96c5563..b32977a 100644
--- a/vulkan/libvulkan/layers_extensions.cpp
+++ b/vulkan/libvulkan/layers_extensions.cpp
@@ -165,8 +165,13 @@
     std::lock_guard<std::mutex> lock(mutex_);
     if (--refcount_ == 0) {
         ALOGV("closing layer library '%s'", path_.c_str());
-        dlclose(dlhandle_);
-        dlhandle_ = nullptr;
+        std::string error_msg;
+        if (!android::CloseNativeLibrary(dlhandle_, native_bridge_, &error_msg)) {
+            ALOGE("failed to unload library '%s': %s", path_.c_str(), error_msg.c_str());
+            refcount_++;
+        } else {
+           dlhandle_ = nullptr;
+        }
     }
 }