bpo-42681: Fix test_curses failures related to color pairs (GH-24089)

On ncurses 6.1 pair numbers are limited by SHORT_MAX-1, even
with extended color support.

Improve error reporting and tests for color functions.
2 files changed