Enable compiler hardening flags by default.

Check whether the compiler supports hardening flags and enable them unless
--disable-hardening is specified.