Fix -Wunused warnings for variables in DMD_OBJS

Warnings reported by -Wunused fixed by either removing code or putting
it within the if-ifdef scope where the code is used.
Fix -Wunused warnings for assignment in if-statements

Warnings reported by -Wunused for variable assignment in if-statements.
Fix warnings about uninitialized values