Track framebuffer memory dirty more carefully.

Fixes #6296, Grand Knights History slowdown during battle transition.  May
also more correctly identify block transfer downloads.
Never detach shaders as some drivers may have broken semantics. May help #6294

(you're supposed to be able to detach them after link)
Merge pull request #6299 from unknownbrackets/gpu-blocktransfer

Track framebuffer memory dirty more carefully