Use idiomatic atomic swap! update instead of non-atomic read-then-write pattern. The new implementation computes the decremented refs inside swap! and only removes the node when the result reaches zero. AI-assisted-by: mimo-v2.5