Always stop animating when app is backgrounded

Even if the CCDirector isn't the "visible" view controller, the app will still crash if it gets backgrounded and the CCDirector keeps trying to draw. Make sure CCDirector stops drawing if, say, the GameCenter login screen is showing and the user switches away from the app to look up their password in 1Password or something.
More consistent curly braces.
Merge pull request #946 from sridenour/v3.1

Always stop CCDirector when app is backgrounded