Fix release builds on Linux

When doing a release build we better not define DEBUG because this
can lead to undefined symbols. This change defines DEBUG conditionally
based on the build configuration.

Change-Id: Ie4f4c3a976e72a8947486abc26a77df900f1e96a