In context menu handler, keep selForContextMenu up to date

So that the added zero-width space doesn't confuse readinput, even
if some other event handler messed with the selection in the meantime.

Issue #2566