try_compile: Fix COPY_FILE with app-bundles on non-macOS hosts

Cross compiling from eg linux to apple-platforms requires handling of
.app-Bundles.

Fixes: #23597
36 jobs for !7377 with consider_app_bundles in 37 minutes and 18 seconds (queued for 3 seconds)
latest merge request