Insertion sort for linked list.