Remove duplicates from a sorted linked list