Handle glibc sys/sysctl.h deprecation (dotnet/coreclr#27048)
glibc has deprecated sys/sysctl.h:
In file included from /coreclr/src/pal/src/misc/sysinfo.cpp:32:
/usr/include/sys/sysctl.h:21:2: error: "The <sys/sysctl.h> header is deprecated and will be removed." [-Werror,-W#warnings]
#warning "The <sys/sysctl.h> header is deprecated and will be removed."
^
1 error generated.
Fix that by preferring sysconf and only including sys/sysctl.h if
HAVE_SYSCONF is not true. This mirrors the order of the implementation
code in this file (sysinfo.cpp) which checks for HAVE_SYSCONF
before HAVE_SYSCTL.
Fixes dotnet/coreclr#27008
Commit migrated from https://github.com/dotnet/coreclr/commit/
6ce179a17061abbbe9f904f878943a28c8041a62