COMMON: Use c++11 foreach if available

I'm not sure this is the best way to do the check, but it works pretty well it seems. I decided to do this as coverity doesn't like our foreach macros.

I haven't actually tested this in game (as I don't actually have the game files with me right now), but it compiles so I'd guess it works.