use onWindowFocusChanged(bool) instead of onResume()/onPause()

we should use onWindowFocusChanged(bool) to detect if the app is currently
visitible to the user or not. because onPause()/onResume() leads to false
positives on some android versions (e.g. Kindle Fire). if you lock those
devices, while the app running, everything is fine (onPause() is handled
properly). but as soon as you wake up the device, and the lock screen gets
visible, the app is resumed and the music is played (onResume() is
called to early).

this is a) not the best behaviour and b) such games will be rejected on the
samsung app store. onWindowFocusChanged(bool) is, like onPause()/onResume(),
available since API level 1 and it should be safe to simply switch.
Merge pull request #4 from cocos2d/master

Merge from the latest version of cocos2d
Added config macro for "spine" extension
Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into develop
Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into develop
fix CCScale9Sprite CapInsets bug for rotated sprite frame
CocosDenshion: fixed wrong assertion in android OpenSL engine

Playback rate interface cannot be initialized for some players in
android 4.x, it's not cocos2d bug.
closed #2388: Creating a default texture for CCSprite if setTexture(nullptr) is invoked.
no more VC2010
Solving 'black screen' on android
Now opacity option for shadow in CCLabelTTF works.
fixing Linux build
Merge pull request #3116 from lgb/small_fix

no more VC2010
Add append function for String class.

The append function is useful when adding a string.
So, I added it to String class.
issue #2388: Checking whether the texture exists.
issue #2388: One more static_cast.
closed #2390, Resolve the bug in modify game projects tools.
Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into develop
issue #2389: Adding cookie support for HttpClient
issue #2388: Updating comments for cc_2x2_white_image variable.