Ensure caret is destroyed when corresponding cursor is removed

When a cursor is removed from the document, the associated caret should also be destroyed. This prevents stale timers from attempting to update the style on detached nodes, which causes crashes in some browsers (e.g., WebKit in Cocoa on OSX10.8).