Detach textures and fbs using a range check.

This is more compatible with the attach logic, and might also be faster.
Although, framebuffer destroys should not be that common.
For now, don't bind mismatched FBs at all.

But still don't create a garbage texture either.
Don't use render-to-texture with format mismatch.
Merge pull request #3029 from unknownbrackets/render-fb

Use a null texture for incorrect render-to-texture + delete better