Make AccessibleCaret not refcounted

AccessibleCaret only works with CopyPasteManager. We can use UniquePtr
to manage its life cycle.
Delete unnecessary NS_IsMainThread()
Rename mHasInited -> mInitialized
Reorder statements to fix Mozilla coding practice
Hide carets if range count is <= 0
Fix second caret is not properly updated

When mCaretMode is changed from SELECTION to CURSOR , the second caret
is not properly updated. I separate the update carets logic into cursor
mode and selection mode. This makes some code duplicated but it should
make the update logic more explicit.
WIP: Hide caret when it's out of scroll port