+ refactor CF_SHARED_OPTS configure macro, making CF_RPATH_HACK more
reusable.
+ improve configure CF_REGEX, similar fixes.
+ improve configure CF_FIND_LINKAGE, adding add check between system
(default) and explicit paths, where we can find the entrypoint in the
given library.
+ add check if Gpm_Open() returns a -2, e.g., for "xterm". This is
normally suppressed but can be overridden using $NCURSES_GPM_TERMS.
Ensure that Gpm_Close() is called in this case.