How does an atomic test solve the issue where the memory might've already been freed?