[Build] Fix redefinition of CMAKE_C_FLAGS_RELEASE.
[Build] Allow RelWithDebInfo and MinSizeRel builds.
[Build] Improve release build with gcc toolchain.

 * Pass -O2 to linker when using -flto.
 * Avoid passing both -O3 and -O2 to gcc.
 * Remove duplicating some options which CMake already uses by default.