[SPARK-2395][SQL] Optimize common LIKE patterns.

Actually this sounds good (it's just not a case to optimize for). Can we add comment inline to explain that? i.e. "This doesn't match case like "abcd\\%", but it doesn't affect correctness."