Optimize static_ by utilizing C++11 threadsafe initialization of function-scope
statics when possible. Note that this slightly changes the ordering semantics of
static_, but not in a way that should break any code.