Fix signed/unsigned warnings related to 'global.errors'

Most function local variables assigned to by global.errors are 'int'
while global.errors is of type 'unsigned'.
Fix signed/unsigned warnings in for-loops
Fix -Wunused warnings for DMD_OBJS

Warnings reported by -Wunused fixed by either removing code or putting
it within the if-ifdef scope it is used.
Fix warnings for DMD_OBJS occurring with ENABLE_WARNINGS=1