WIP: Make sure s_curCtx() is called once at libary load to init the TLS
helgrind reported a possible data race in setCurrentContext
and the only explanation we found is that the first call to s_curCtx()
is not thread safe because it has to initialize the static TLS structure.
This MR ensures that the TLS is initialized at library load, preventing the data race.
/cc @sponce
Edited by Marco Clemencic