remove duplicates from an unsorted linked list