[CMake] Detect if -Wfoo is supported instead of -Wno-foo, as GCC occasionally silently discards unknown -Wno-foo flags.