Make getParagraphSelection more robust.

Return valid range even while text area is being updated.