Code to delete duplicates from a sorted linked list