Revert "Revert "add unittests for libnativeloader""

This reverts commit 4ec2b289834e37a518a1d9a006fccefd78c2370d.

Bug: 137881576
Bug: 130388701
Test: libnativeloader_test
Test: m libnativeloader_test on full-eng
Change-Id: Ib96f7235845b68cde713af278313c5aa751ff738
diff --git a/libnativeloader/library_namespaces.h b/libnativeloader/library_namespaces.h
index fd46cdc..6e9a190 100644
--- a/libnativeloader/library_namespaces.h
+++ b/libnativeloader/library_namespaces.h
@@ -42,7 +42,10 @@
   LibraryNamespaces& operator=(const LibraryNamespaces&) = delete;
 
   void Initialize();
-  void Reset() { namespaces_.clear(); }
+  void Reset() {
+    namespaces_.clear();
+    initialized_ = false;
+  }
   NativeLoaderNamespace* Create(JNIEnv* env, uint32_t target_sdk_version, jobject class_loader,
                                 bool is_shared, jstring dex_path, jstring java_library_path,
                                 jstring java_permitted_path, std::string* error_msg);