Restore implicit include directory extraction for adaptive relative paths
Update the logic added by !3204 (merged) to account for the new try_compile
work directory used for the ABI check since !7656 (merged).
Paths relative to the work directory will now have one more ../
in them, so update the test data to match.
Fixes: #24279 (closed)
Backport: release