Text this: Critical exponent of ternary words with few distinct palindromes