build: only check -Werror=return-mismatch when compiling for C
LLVM doesn't support this option in any language. GCC warns that this is not supported in C++ but autotools and meson consider it's supported.
Fixes this warning:
cc1plus: warning: '-Werror=' argument '-Werror=return-mismatch' is not valid for C++