[SYCL][NFC][diagnostic] Trace Managed<> that outlive their adapter
Diagnostic-only instrumentation for intel/llvm#22367, layered on top of the
weak_ptr fix. When the SYCL_TRACE_ADAPTER_UAF environment variable names a
file, ~Managed records every case where the adapter weak_ptr fails to lock --
i.e. the Managed<ur_program/kernel_handle_t> outlived its adapter, which is the
use-after-free site under the original raw-pointer design. Each record carries
the resource handle and a raw backtrace (module-relative RVAs on Windows for
offline PDB symbolization, backtrace_symbols elsewhere).
The weak_ptr build keeps the two re-enabled program_manager tests GREEN, so
these file records are the only signal: lit discards stdout/stderr of passing
tests. The Windows build workflow sets SYCL_TRACE_ADAPTER_UAF for the
check-sycl-unittests step and uploads the resulting file as the
adapter_uaf_trace artifact (if: always()), so it can be pulled and symbolized
after an icx run to identify which cache/holder keeps a Managed alive past
adapter teardown.
No behavior change when the env var is unset (single getenv, early return).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>