Write a function to remove all duplicates from a linked list.