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
4 files changed