Fix segfault when Document#rootNode is called on unparsed document