cxxmodules: Honor CMAKE_CXX_SCAN_FOR_MODULES in try_compile

Under CMP0155's NEW behavior, projects that explicitly enable C++20
support with `set(CMAKE_CXX_STANDARD 20)` may also explicitly
disable scanning with `set(CMAKE_CXX_SCAN_FOR_MODULES OFF)`.
We already propagate `CMAKE_CXX_STANDARD` into `try_compile` test
projects, so propagate `CMAKE_CXX_SCAN_FOR_MODULES` too.

Fixes: #25313
4 files changed