Remove duplicates from unsorted linked list