Fix texcache rehash backoff.

If a texture was reused (with other textures in between) several times per
frame, it would be rehashed more frequently than it should be.

Also tries to avoid rehashing several textures on the same frame if they
do not change.
Cut down texcache cap to 512.

This will make textures rehash 4x more often if they seem to be static.

Previously, 2048 for a 30 fps game meant 69 seconds before it would notice
a change.  This is really long for fonts that get missed sometimes.

This takes that down to 17.5 seconds.  Still quite a while, but something
a normal person is much more likely to wait for.

Hopefulyl won't hurt performance much normally.
Merge pull request #3990 from unknownbrackets/texcache

Rehash textures a bit more often when static