Make Remove() atomic, as expected

Bug: 31023171
Test: m -j28 test-art-host

Change-Id: I0d9a4b19f1b307d98f01ec76a47e4748f713437c
diff --git a/compiler/utils/atomic_dex_ref_map-inl.h b/compiler/utils/atomic_dex_ref_map-inl.h
index 4bd323d..9915498 100644
--- a/compiler/utils/atomic_dex_ref_map-inl.h
+++ b/compiler/utils/atomic_dex_ref_map-inl.h
@@ -81,8 +81,7 @@
   if (array == nullptr) {
     return false;
   }
-  *out = (*array)[ref.index].load(std::memory_order_relaxed);
-  (*array)[ref.index].store(nullptr, std::memory_order_seq_cst);
+  *out = (*array)[ref.index].exchange(nullptr, std::memory_order_seq_cst);
   return true;
 }