Fix rare crash during atom deletion.