Fix destructor to work on lists with cycles.