fix race between StaticMetaBase::destroy() and StaticMetaBase::onThreadExit()