Insertion sort for a linked list.