[SYCL] Re-apply 'Fix compiler version detection for oneAPI' (#22161) (#22179)
Cherry pick of 7f3b71ba94abea30a23e4e9cfe872e182de4bbdd
Reapply https://github.com/intel/llvm/pull/22131 with a minor change
adding a check for `SYCL_TEST_E2E_STANDALONE` before checking
`CMAKE_CXX_COMPILER_ID`.
I manually reproduced the problem that caused it to be reverted and
verified the fix.