Clear spell errors only if node is in DOM

It's possible that the contenteditable attribute is set to false
for a node that is not part of the DOM. In this case, we much gracefully
handle the exception thrown by Range.selectNode when the root node
of the specified node is not a document.