imwayland: Clamp the surrounding string end correctly
In the paths where len > MAX_LEN and cursor/anchor are separated by at least MAX_LEN from text edges, we were clamping the right end of the surrounding string at MAX_LEN. Oops.
This end anchor may go as far as the string length, although just up to len - MAX_LEN in real terms (due to the condition above that caches cursor/anchor positions being near enough the text end).
Closes: #2565 (closed)