Check{C,CXX}CompilerFlag: Test using C locale (#14102)

Set the locale to C while running the compiler for these checks because
we match the resulting warning messages in English only.

Suggested-by: Marco Nolden <m.nolden@dkfz-heidelberg.de>
Merge topic 'check-compiler-flag-locale' into next

5272372 Check{C,CXX}CompilerFlag: Test using C locale (#14102)