wcore: rework non-compatible mutex initialization
C11 does not specify a static initializer, based on the idea that the
a mutex will be platform and/or implementation dependent. As such the
alternative solution is to initialize the mutex with call_once/mtx_init.
This will allow us to remove the transition hack, and in due time move
to the system's C11 threads implementation.
v2: Actually use call_once() to prevent the possibility of multiple
threads hitting the mtx_init() at the same time. Suggested by Jose.
v3: Do not destroy the mutex. Suggested by Chad.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Chad Versace <chad.versace@intel.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>