[0dca3bfa8f] Strengthen validity checks on fast-path string comparison.