don't update cursor if elem is not focused

If the focus is not on the textarea moving the cursor moves the focus
to the textarea which is very annoying if the user is already typing in
another form input.
Merge pull request #161 from dcolens/patch-2

don't update cursor if elem is not focused