Fix some crash due to destroyed FBO's...

...and some changes in TextureCache.cpp.