Fix the cached value of ac_cv_c_compiler_gnu [v9.18]
There was an error in AX_PROG_CC_FOR_BUILD macro that cached literal
name of the cache variable saved_ac_cv_c_compiler_gnu
instead of the
value of said variable breaking the consecutive runs of ./configure
script with caching enabled.
(cherry picked from commit 4a9f899b)
Closes #3299 (closed)
Edited by Ondřej Surý