Fix wrong ifdef in ssl_server2 & add test for it

This was found as a warning when running scripts/baremetal.sh --ram
--build-only manually, but it should have been found in a more automated way.
Adding -Werror so that future such issues will be caught by all.sh
(component_test_baremetal already invokes baremetal.sh --ram --build-only).
diff --git a/scripts/baremetal.sh b/scripts/baremetal.sh
index d6b6372..813307a 100755
--- a/scripts/baremetal.sh
+++ b/scripts/baremetal.sh
@@ -214,6 +214,9 @@
     make clean
 
     CFLAGS="$BASE_CFLAGS $CFLAGS_CONFIG $CFLAGS_USER_CONFIG"
+    if [ "$build_only" -eq 1 ]; then
+        CFLAGS="$CFLAGS -Werror"
+    fi
 
     echo "Modifications: $BAREMETAL_USER_CONFIG"
     cat $BAREMETAL_USER_CONFIG | grep "^#define" | awk '{print "* " $0 }'
@@ -352,7 +355,7 @@
 measure_stack=0
 
 check=0
-
+build_only=0
 debug=0
 
 while [ $# -gt 0 ]; do