-Wthread-safety was failing to detect certain AST patterns it should detect. Make the pattern detection a bit more comprehensive.
Due to an unrelated bug involving template instantiation, this showed up as a regression in 10.0 vs. 9.0 in the original bug report. The included testcase fails on older versions of clang, though.
Should we also skip over CK_UserDefinedConversion here (for conversion functions that return mutex locks, I suppose)?