lock-free stack code contains several bugs: access to freed memory and ABA problem