Move static definition outside function call

Only in C++-03 this isn't defined as being thread safe, only in C++11.
We should prefer using the style where we define these outside the
functions so they are setup during load and not first execution of the
function.

For cases that we should not use static, we remove these so the
functions are properly reentrant.
Update pack from newer version from rapa