Fixed crashing when calling CCDirector's end().
Merge pull request #5283 from seemk/director_cleanup_fix

closed #4099: Fixed crashing when calling CCDirector's end() on win32.