Bug fix in wrap_periodic_sharedborder (used by environment call with exr maps)

The math here made an assumption that the amount of periodic wrapping could
be no more than 1 cycle.  But it could!  If using a bicubic lookup (needs 4
samples) at a MIP level with resolution <= 2 (very blurry), you could
mis-calculate the wrap and end up with a coordinate out of the range of
valid pixels.