Only pass the -DDEBUG option to g++ in Debug builds

This makes it so that only builds with CMAKE_BUILD_TYPE=Debug will
turn the "DEBUG" macro on, whereas previously all build types except
'Release' got the DEBUG macro. This enables proper use of the
'RelWithDebInfo' build type, which shouldn't define the DEBUG macro.