Issue 26980043: opt: improve the "unused  -node" check to eliminate self-refs, debug-refs.