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
pitch/pan/gain: added iOS/OSX impl, fixed compilation for all platforms.
CocosDenshion: (pitch/pan/gain) added Linux code for OpenAL and FMOD.
CocosDenshion: added effects customization for 7 platforms.

1. Pitch/pan/gain support on iOS, Mac, Linux+FMOD, Android+SoundPool;
2. Unified OpenAL code with pitch/pan/gain on Linux, Tizen, Blackberry,
Native Client;
3. Bug fixed: rewindBackgroundMusic() no longer stops music on unified
OpenAL engine.
4. Optional mp3 support for Linux+OpenAL (OPENAL_MP3 make option);
5. Pan/gain (not pitch) support for Android+OpenES.
6. Reorganized CocosDenshion tests in TestCpp.

Known issues:
1. No support for windows, emscrippten, marmalade.
2. No pitch effect on Android+OpenES. It requires backend redesign:
http://code.google.com/p/android/issues/detail?id=24592
Fixed coding style, rearranged CocosDenshionTest UI, changed
rewindBackgroundMusic to work with paused music.
issue #2243:Add a uniform fund in ScriptEngineProtocol
Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into execDev
Merge pull request #3 from cocos2d/develop

sync with upstream (cocos2d/cocos2d-x)
Merge branch 'develop' of https://github.com/samuele3hu/cocos2d-x into execDev
issue #22434:make some execute funs into one funs in ScriptEngineProtocol
Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into execDev
Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into develop
Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into execDev
issue #2244:Add some constructor
Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into execDev
[iOS] Adding lua projects.
issue #2244:Modify ScriptData struct and functions related with sendEvent
close #2371: Adding Lua projects for Mac.