build: Adding `-Werror` during compiler flag detection phase

This way all warnings generated during the detection (e.g., `argument
unused` from clang) will not cause problems later.

Change-Id: I94bb12de70f208c8da0648dd5cff8385acec5cbc
Refs: #1539
diff --git a/.waf-tools/default-compiler-flags.py b/.waf-tools/default-compiler-flags.py
index b270243..7407552 100644
--- a/.waf-tools/default-compiler-flags.py
+++ b/.waf-tools/default-compiler-flags.py
@@ -50,7 +50,7 @@
 
     supportedFlags = []
     for flag in cxxflags:
-        if self.check_cxx(cxxflags=[flag], mandatory=False):
+        if self.check_cxx(cxxflags=['-Werror', flag], mandatory=False):
             supportedFlags += [flag]
 
     self.end_msg(' '.join(supportedFlags))