glsl: fix int16 issues
Here's a few fixes for issues I found while wiring up int16 support for Zink.
Most of these are GLSL loop-analysis stuff, which is under-tested because int16-support is rare, and it's even rarer for drivers to also use the GLSL loop-unrolling. I temporarily put Zink into both these categories.
But let's fix these bugs in addition to the Zink stuff (see !10101 (merged)). This might save someone else from wasting some time on this down the line.