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.
Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into develop
issue #2244:Modify CallFunc event bug and modify a function name to createCCBreader
Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into execDev
issue #2244:Modify a function name to createCCBReader
issue #2371: Updating multi-platform-template for iOS and Mac
closed #2376, Add online IAP feature in plugins : uc, nd91 & qh360.
issue #2371: Deleting cocos2dx/proj.ios and cocos2dx/proj.mac since it isn't needed anymore, moving the prefix header file to previous folder.
Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into develop
issue #2371: Using the same prefix header for iOS and Mac.
Merge pull request #3077 from dumganhar/iss2371-template

Updating multi-platform-template for iOS and Mac, and deleting cocos2dx/proj.ios and cocos2dx/proj.mac since it isn't needed anymore, moving the prefix header file to previous folder.
Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into develop
issue #2244:Replace the tab with space
issue #2244:Replace the tab with space