gh-152502: Detect optional curses functions with configure probes (GH-152504)
Some curses functions were called unconditionally or gated only by the
ncurses-specific NCURSES_EXT_FUNCS macro, which broke building the module
against other curses implementations (narrow ncurses, NetBSD curses) even
when they provided the function. Detect each with a configure capability
probe and gate on HAVE_CURSES_*.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>