Defensive cursor position handling for weird cursor error I was seeing when using setValue repeatedly.