getprogname: correct the test for a __progname variable
* m4/getprogname.m4 (gl_FUNC_GETPROGNAME): Use AC_CACHE_CHECK
and AC_LINK_IFELSE to check for a global __progname. If found,
define HAVE_VAR___PROGNAME.
* lib/getprogname.c (getprogname): Reflect the new name of the
preprocessor symbol: s/HAVE_DECL___PROGNAME/HAVE_VAR___PROGNAME/
Assaf Gordon reported that the erroneous prior check caused
link failure on AIX 7 in
https://lists.gnu.org/archive/html/grep-devel/2016-10/msg00001.html