Add mutex lock after init to SM_ENTER_CRITICAL_SECTION_WITH_RETURN macro