[linker] Do not import something that is not marked when sweeping type references (otherwise we might re-intoduce dependencies we're not including or need) [#16213]