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