Ensure O(n) worst-case complexity of mbscasestr.