Introduce anonymous namespace

The anonymous namespace is introduced to
handle cases when linker can not find the
caller. This usually happens when caller
code was not loaded by dynamic linker;
for example mono-generated code.

Bug: http://b/25844435
Bug: http://b/22548808
Change-Id: I9e5b1d23c1c75bc78548d68e79216a6a943a33cf
diff --git a/tests/libs/namespaces_root.cpp b/tests/libs/namespaces_root.cpp
index 0bb4611..b0006c7 100644
--- a/tests/libs/namespaces_root.cpp
+++ b/tests/libs/namespaces_root.cpp
@@ -40,10 +40,12 @@
     return nullptr;
   }
 
-  const char* result = *static_cast<const char**>(dlsym(handle, "g_private_dlopened_string"));
-  if (result != nullptr) {
+  const char** result = static_cast<const char**>(dlsym(handle, "g_private_dlopened_string"));
+  if (result == nullptr) {
+    return nullptr;
+  } else {
     g_dlopened = true;
   }
 
-  return result;
+  return *result;
 }