Only use Werror and various Wno-stuff on release builds.

Addresses #3764 by only erroring the build on warnings with a release build, and only supressing known warnings for the release build.