Checks if a linked list is a palindrome.