configure should check for warning flags supported to disable them (#338205).

Configure would check whether gcc supported -Wno... flags. But gcc always
does. It is happy to just not warn about anything. So flip all configure
checks to test for the warning and only when gcc accepts the warning flag
use -Wno-...

Introduces two helper functions to make it easier to add new flag checks.
AC_GCC_WARNING_COND and AC_GCC_WARNING_SUBST_NO.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14319 a5019735-40e9-0310-863c-91ae7b9d1cf9