Make attributes robust to static init orderings (#2295)
@taking pointed out that part of the issue fixed in #2293 is also that
we should be more robust to different (de-)initialization orders. A
common, portable way to achieve this is to allocate the object in
question on the heap and make the pointer to it static [0]. This commit
fixes the variable in question.
I have tested this fix in ASAN (without using --no-static-init flag for
CxxTest) and it works.
[0] https://isocpp.org/wiki/faq/ctors#construct-on-first-use-v2