get_filename_component: Restore lexical preprocessing of REALPATH for compat

Revert commit c554437733 (get_filename_component: Fix REALPATH for ..
after symlink, 2024-11-21, v4.0.0-rc1~411^2) because it changed existing
behavior without a policy.  Also add a test case for the old behavior.

Note that we have policy `CMP0152` to fix this for `file(REAL_PATH)`,
but it does not affect `get_filename_component(... REALPATH)`.  A new
policy would be needed for the latter.

Fixes: #26815
Issue: #26472
3 files changed