Add RelWithAssert build type

Works mostly like Release just without -DNDEBUG.

Also generalized some machinery for managing compiler/linker flags so
that we can have an easier time later when we reconsider how to manage
all of our build types.

Also minor corrective changes to the behaviour of other build types.

Change-Id: I70283cb6069cb772c287c0aef329d95b8eacd987