Fix textarea selection change

Issue #797:
The behavior is caused by the code responsible for preserving user selection.
It seems that setting selectionStart  and SelectionEnd propoerties of a textbox set also focus on that input. So, when a user is editing a textbox1 and an update-form request for textbox2 arrived, the cursor will moves automatically to textbox2 causing a text mess. ( This happens on chrome and not in Firefox (didn't check it on safari and IE))

What I did is just make sure that the element being modified by remote users is focused  locally before saving and restoring user selection, this will make sure that the users are editing the same textbox or textarea(otherwise, it is not necessary).