Make sure the document is focused when setting a selection

Without explicitly focusing the document (e.g. after coming back
off the paste target from a focusable node) it is possible for the
cursor to appear in the document, but for typing to happen in the
paste target.

Bug: 67432
Change-Id: I87c9c4fb08fa6c95dd26b8ab2da281333e9f3c16