Check the selection has collapsed after pasting

In Chrome you can paste the empty string which triggers
the paste events but doesn't change the paste target. This
results in the insertion of the context character on empty
lines. To avoid this we can detect if the selection we put
around the context character is still there and abort the
paste.

Bug: 58138
Change-Id: Ib73465a2376cd316dbac6ce2567ecb64bc500307
Merge "Check the selection has collapsed after pasting"