FBO: Fix texture binding and increase robustness for different OpenGL versions.