cmake: Restore finding installed resources in their real path
In commit 0994bc7929 (cmake: Preserve symlinks in references to itself
when possible, 2024-11-11) we stopped looking for resources using the
real path of the directory containing `cmake`. Restore it as a fallback
to support layouts like `/{bin -> usr/bin}/cmake`.
Fixes: #26570