Pre-Processor Fixes for DEBUG in Foundation and PDF

Fixes #544

By renaming DEBUG to _DEBUG we conform to keep the standard debug
pre-processor flag passed down via the build scripts.

Tested against x86_64, i386, armv7 arm64 with a Static Release build in
Debug Xcode Target as well as Release target.