Add clamping texture offsets to WebGL 2

This solves one instance of undefined behavior. There is a performance
cost, but it does not seem prohibitively large.

For issue #543.