fix #3911: make Threading::IsSimThread a bit safer vs. wrong type deduction