Avoid exception on org.netbeans.lib.lexer.TokenHierarchyOperation.ensureReadLocked.