Fix thumb interwork def check to be consistent and update #endif. Remove duplicate check in generated C files.