linked list with loop-aware destructor

* hackish implementation