meson: fix static initialization order race condition

When moving over to meson, openpower-proc-control started seg faulting
whenever it was run. It was not even making it to the main() function.

Upon investigation, it was found that when moving to meson, this code
started hitting an issue where the hw procedure registration code was
hitting a common static initialization race condition. Whether you hit
this issue is pretty much at the whim of the compiler and the build
system so Automake did not hit it, but meson does.

The following has a pretty good write up on the issue and how to avoid
it:
  https://isocpp.org/wiki/faq/ctors#static-init-order-on-first-use-members

This commit utilizes the solution proposed in that doc

Tested:
- Verified that openpower-proc-control built via meson now works as
  expected.

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I0ea5ef68e73fe4fa08e9cf8e4e3f1dbc8476a2de
diff --git a/registration.hpp b/registration.hpp
index 0f093ff..5b39887 100644
--- a/registration.hpp
+++ b/registration.hpp
@@ -40,7 +40,7 @@
      */
     Registration(ProcedureName&& name, ProcedureFunction&& function)
     {
-        procedures.emplace(std::move(name), std::move(function));
+        procedures().emplace(std::move(name), std::move(function));
     }
 
     /**
@@ -48,11 +48,15 @@
      */
     static const ProcedureMap& getProcedures()
     {
-        return procedures;
+        return procedures();
     }
 
   private:
-    static ProcedureMap procedures;
+    static ProcedureMap& procedures()
+    {
+        static ProcedureMap procMap;
+        return procMap;
+    }
 };
 
 } // namespace util