Fix build issues with GCC < 4.5

 + Space/or/Newline needed for loops with empty bodies
 + __host__ and __device__ redefined due to push/pop macros not existing on GCC < 4.5.
 + Missing #include for iterator_categories.

Declaring `device_system_tag` won't cause a redefinition. Just try putting this at the top of the file:

```
namespace thrust
{
  struct device_system_tag;

  ...
}
```