Reverse a linked list.