Fix PAL_GetLogicalProcessorCacheSizeFromOS on mac (#24777)
* Fix PAL_GetLogicalProcessorCacheSizeFromOS on mac
In a previous PR
(https://github.com/dotnet/coreclr/commit/
ed52a006c01a582d4d34add40c318d6f324b99ba#diff-8447e54277bb962d167a77bb260760d7R1879),
GetCacheSizePerLogicalCpu was changed to no longer rely on cpuid on
amd64 systems; instead it uses GetLogicalProcessorCacheSizeFromOS().
Unfortunately that function consisted of a number of `#if`s, none of
which were active on macs, and we just returned 0. This caused us to
default to a gen0size of only 0.25MB, causing many GCs.
Fixed by adding a new case that uses `sysctlbyname`.
Fix #24658
* Fixes from code review
* Check for function sysctlbyname instead of header