Fix unused warnings for DMD_OBJS

All warnings reported by -Wunused fix by either removing code or putting
it within the if-ifdef scope the variable was used.
Fix warnings for DMD_OBJS occurring with ENABLE_WARNINGS=1

Almost all warnings fixed with the current list of -W-directives turned
on when using ENABLE_WARNINGS=1. Disabled warnings for unhandled switch
values in src/posix.mak (-Wno-switch).