Sort a linked list