[3.13] gh-126505: Fix bugs in compiling case-insensitive character classes (GH-126557) (GH-126689)

* upper-case non-BMP character was ignored
* the ASCII flag was ignored when matching a character range whose
  upper bound is beyond the BMP region
(cherry picked from commit 819830f34a11ecaa3aada174ca8eedeb3f260630)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
3 files changed