Make the check_include_file* macros honor CMAKE_REQUIRED_LIBRARIES. This
shouldn't cause any of the configuration checks to give different
results (and I did clean configures before and after this change and
confirmed that the resulting CMake caches were identical, though of
course that's just one machine). This suppresses a warning when building
with CMake 3.12 or later.
Unfortunately, this doesn't suppress the warning in clang, because clang
does its own cmake_minimum_required call even when being built in-tree,
and that resets all policy settings.