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: Id47a29f94316220e979412c862096a620e15a984
Refs: #1539
diff --git a/.waf-tools/default-compiler-flags.py b/.waf-tools/default-compiler-flags.py
index 4e9548c..741791e 100644
--- a/.waf-tools/default-compiler-flags.py
+++ b/.waf-tools/default-compiler-flags.py
@@ -54,7 +54,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))