[clang-tidy] Fix a crash in bugprone-std-namespace-modification (#214704)

Check the namespaces of template argument types directly from their
declarations. This avoids querying the AST parent map (since it may not
contain lambda closure types) and fixes the crash.

Fixes #213981

GitOrigin-RevId: 4e274280c33edd820ab04d469d9edc1f9239d567
3 files changed