PR #10521: [ROCM] fixing gpu_pjrt_client crash and improved debug in rocm_driver
PR #10521: [ROCM] fixing gpu_pjrt_client crash and improved debug in rocm_driver

Imported from GitHub PR https://github.com/openxla/xla/pull/10521

In this PR I fix xla/pjrt/gpu/se_gpu_pjrt_client.cc which causes a crash during the execution of se_gpu_pjrt_client_test.cc, namely the subtest **StreamExecutorGpuClientTest.CopyRawToHostFullBuffer**.

The crash was caused by taking a pointer of a unique_ptr in one function's argument and releasing that pointer in another one (not sure why it worked before: maybe on CUDA the compiler has different behaviour?). But I guess the order of evaluating the function arguments is not defined..

Besides, I also improve gpu_driver debug output.

@xla-rotation: can you please have a look ?
Copybara import of the project:

--
fc43f8e5eac8d0f74b2dda453f9e622d62c78896 by Pavel Emeliyanenko <pavel.emeliyanenko@amd.com>:

fixing gpu_pjrt_client crash and added improved debug output in rocm_driver

--
68e52b52d3c157d1d8f1d1eb50c2368dbed50198 by Pavel Emeliyanenko <pavel.emeliyanenko@amd.com>:

passing promise by value since the callback function is copied

--
65ab1d44bd83aff64776e1fdd66c42b48ce8acf2 by Pavel Emeliyanenko <pavel.emeliyanenko@amd.com>:

fixing buildifier warnings

Merging this change closes #10521

FUTURE_COPYBARA_INTEGRATE_REVIEW=https://github.com/openxla/xla/pull/10521 from ROCm:ci_pjrt_gpu_client_fix 65ab1d44bd83aff64776e1fdd66c42b48ce8acf2
