Fix race condition in HTreeMap cache