Properly handle invalid attachments.
Factor out texture from framebuffer.
Keep framebuffer sources alive.

Hopefully this is not too dangerous...
Keep track of fbs so there's no lag texturing.

Before, there would always be at least one bind with the incorrect memory
before using the framebuffer as a source.
Try to use the most recently rendered fb.
Consider all framebuffers before settling.
Merge pull request #3557 from unknownbrackets/texcache-fb

Improve render-to-texture framebuffer selection