Remove duplicate elements from linked list