make CCImage::initWithImageFileThreadSafe() thread-safe

merge code from develop to make CCImage::initWithImageFileThreadSafe() thread-safe.