[XLA] Fix race condition in RefcountingHashMap
[XLA] Fix race condition in RefcountingHashMap

Quoting the bug from jlebar@:

> Suppose the refcount of entry for key K goes to 0.  Then before the deleter is run, someone touches map[K], thus causing the refcount of this entry to go back to 1.  Then the deleter runs, deleting the object.  Boom.

PiperOrigin-RevId: 289194684
Change-Id: I3a1d9a8294d45eb1c554ee511328fc5a9d0b1e20

davidzchen/tensorflow,sarvex/tensorflow,Intel-tensorflow/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow-pywrap_saved_model,aldian/tensorflow,freedomtan/tensorflow,tensorflow/tensorflow,jhseu/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_saved_model,xzturn/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,aam-at/tensorflow,karllessard/tensorflow,paolodedios/tensorflow,cxxgtxy/tensorflow,freedomtan/tensorflow,aam-at/tensorflow,tensorflow/tensorflow,xzturn/tensorflow,xzturn/tensorflow,aam-at/tensorflow,gunan/tensorflow,petewarden/tensorflow,freedomtan/tensorflow,gunan/tensorflow,renyi533/tensorflow,renyi533/tensorflow,annarev/tensorflow,gautam1858/tensorflow,petewarden/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,renyi533/tensorflow,paolodedios/tensorflow,sarvex/tensorflow,freedomtan/tensorflow,davidzchen/tensorflow,annarev/tensorflow,Intel-Corporation/tensorflow,annarev/tensorflow,Intel-tensorflow/tensorflow,petewarden/tensorflow,aldian/tensorflow,xzturn/tensorflow,petewarden/tensorflow,tensorflow/tensorflow-pywrap_saved_model,frreiss/tensorflow-fred,frreiss/tensorflow-fred,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_tf_optimizer,petewarden/tensorflow,xzturn/tensorflow,renyi533/tensorflow,aam-at/tensorflow,frreiss/tensorflow-fred,yongtang/tensorflow,yongtang/tensorflow,paolodedios/tensorflow,karllessard/tensorflow,karllessard/tensorflow,renyi533/tensorflow,Intel-tensorflow/tensorflow,paolodedios/tensorflow,annarev/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,annarev/tensorflow,frreiss/tensorflow-fred,cxxgtxy/tensorflow,paolodedios/tensorflow,jhseu/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,Intel-tensorflow/tensorflow,karllessard/tensorflow,gautam1858/tensorflow,karllessard/tensorflow,sarvex/tensorflow,Intel-Corporation/tensorflow,xzturn/tensorflow,davidzchen/tensorflow,Intel-Corporation/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow,gautam1858/tensorflow,xzturn/tensorflow,davidzchen/tensorflow,gunan/tensorflow,davidzchen/tensorflow,frreiss/tensorflow-fred,annarev/tensorflow,xzturn/tensorflow,aam-at/tensorflow,renyi533/tensorflow,xzturn/tensorflow,petewarden/tensorflow,gautam1858/tensorflow,yongtang/tensorflow,jhseu/tensorflow,gunan/tensorflow,karllessard/tensorflow,yongtang/tensorflow,tensorflow/tensorflow,Intel-tensorflow/tensorflow,annarev/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,gunan/tensorflow,frreiss/tensorflow-fred,jhseu/tensorflow,renyi533/tensorflow,renyi533/tensorflow,yongtang/tensorflow,aldian/tensorflow,freedomtan/tensorflow,petewarden/tensorflow,Intel-tensorflow/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow-experimental_link_static_libraries_once,davidzchen/tensorflow,sarvex/tensorflow,aldian/tensorflow,aam-at/tensorflow,Intel-Corporation/tensorflow,jhseu/tensorflow,davidzchen/tensorflow,tensorflow/tensorflow,jhseu/tensorflow,cxxgtxy/tensorflow,tensorflow/tensorflow,davidzchen/tensorflow,jhseu/tensorflow,yongtang/tensorflow,renyi533/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,frreiss/tensorflow-fred,tensorflow/tensorflow-experimental_link_static_libraries_once,aam-at/tensorflow,jhseu/tensorflow,karllessard/tensorflow,freedomtan/tensorflow,aldian/tensorflow,Intel-tensorflow/tensorflow,freedomtan/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_saved_model,cxxgtxy/tensorflow,petewarden/tensorflow,Intel-tensorflow/tensorflow,renyi533/tensorflow,jhseu/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,aam-at/tensorflow,yongtang/tensorflow,aldian/tensorflow,frreiss/tensorflow-fred,xzturn/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,Intel-Corporation/tensorflow,gautam1858/tensorflow,freedomtan/tensorflow,yongtang/tensorflow,paolodedios/tensorflow,gunan/tensorflow,gunan/tensorflow,gautam1858/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow,karllessard/tensorflow,tensorflow/tensorflow,petewarden/tensorflow,petewarden/tensorflow,tensorflow/tensorflow,cxxgtxy/tensorflow,annarev/tensorflow,gautam1858/tensorflow,paolodedios/tensorflow,renyi533/tensorflow,karllessard/tensorflow,davidzchen/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow,davidzchen/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_tf_optimizer,gunan/tensorflow,gautam1858/tensorflow,davidzchen/tensorflow,Intel-Corporation/tensorflow,freedomtan/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow-pywrap_saved_model,cxxgtxy/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,annarev/tensorflow,gautam1858/tensorflow,gunan/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-experimental_link_static_libraries_once,gunan/tensorflow,freedomtan/tensorflow,sarvex/tensorflow,annarev/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,sarvex/tensorflow,cxxgtxy/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow-pywrap_saved_model,jhseu/tensorflow,yongtang/tensorflow,aam-at/tensorflow,sarvex/tensorflow,gautam1858/tensorflow,davidzchen/tensorflow,aam-at/tensorflow,paolodedios/tensorflow,xzturn/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,aam-at/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,gunan/tensorflow,petewarden/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,yongtang/tensorflow,petewarden/tensorflow,cxxgtxy/tensorflow,freedomtan/tensorflow,gunan/tensorflow,jhseu/tensorflow,xzturn/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,karllessard/tensorflow,Intel-Corporation/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,yongtang/tensorflow,aldian/tensorflow,paolodedios/tensorflow,aldian/tensorflow,freedomtan/tensorflow,Intel-Corporation/tensorflow,paolodedios/tensorflow,sarvex/tensorflow,renyi533/tensorflow,annarev/tensorflow,aam-at/tensorflow,jhseu/tensorflow,tensorflow/tensorflow