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