prevent flickering when opening another activity

taken from cocos2d v2 branch.
prevents flickering when opening anothe activity from cocos2d game.