ClassReadersTests.classMethod failing
NamedComponentScannerTests.classMethod failing

Both on various windows builds. Most likely similar to other classloader test failures with removing files

**Build scan:**
https://gradle-enterprise.elastic.co/s/77y6wven7vqry/tests/:libs:elasticsearch-plugin-scanner:test/org.elasticsearch.plugin.scanner.ClassReadersTests

**Applicable branches:**
main

**Reproduces locally?:**
Didn't try

**Failure history:**
https://gradle-enterprise.elastic.co/scans/tests?tests.container=org.elasticsearch.plugin.scanner.ClassReadersTests&tests.test=classMethod

**Failure excerpt:**
```
java.io.IOException: Could not remove the following files (in the order of attempts):
   C:\Users\jenkins\workspace\platform-support\593\libs\plugin-scanner\build\testrun\test\temp\org.elasticsearch.plugin.scanner.ClassReadersTests_40C8C1BA1BA2E7E4-001\tempDir-005: java.nio.file.DirectoryNotEmptyException: C:\Users\jenkins\workspace\platform-support\593\libs\plugin-scanner\build\testrun\test\temp\org.elasticsearch.plugin.scanner.ClassReadersTests_40C8C1BA1BA2E7E4-001\tempDir-005
   C:\Users\jenkins\workspace\platform-support\593\libs\plugin-scanner\build\testrun\test\temp\org.elasticsearch.plugin.scanner.ClassReadersTests_40C8C1BA1BA2E7E4-001\tempDir-005\jars-dir: java.nio.file.AccessDeniedException: C:\Users\jenkins\workspace\platform-support\593\libs\plugin-scanner\build\testrun\test\temp\org.elasticsearch.plugin.scanner.ClassReadersTests_40C8C1BA1BA2E7E4-001\tempDir-005\jars-dir
   C:\Users\jenkins\workspace\platform-support\593\libs\plugin-scanner\build\testrun\test\temp\org.elasticsearch.plugin.scanner.ClassReadersTests_40C8C1BA1BA2E7E4-001: java.nio.file.DirectoryNotEmptyException: C:\Users\jenkins\workspace\platform-support\593\libs\plugin-scanner\build\testrun\test\temp\org.elasticsearch.plugin.scanner.ClassReadersTests_40C8C1BA1BA2E7E4-001

  at __randomizedtesting.SeedInfo.seed([40C8C1BA1BA2E7E4]:0)
  at org.apache.lucene.util.IOUtils.rm(IOUtils.java:341)
  at org.apache.lucene.tests.util.TestRuleTemporaryFilesCleanup.afterAlways(TestRuleTemporaryFilesCleanup.java:209)
  at com.carrotsearch.randomizedtesting.rules.TestRuleAdapter$1.afterAlways(TestRuleAdapter.java:31)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:43)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.tests.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:53)
  at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
  at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
  at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
  at org.apache.lucene.tests.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:47)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:390)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl.lambda$forkTimeoutingTask$0(ThreadLeakControl.java:850)
  at java.lang.Thread.run(Thread.java:1589)

```
libs/plugin-scanner/src/main/java/org/elasticsearch/plugin/scanner/ClassReaders.java
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License
 * 2.0 and the Server Side Public License, v 1; you may not use this file except
 * in compliance with, at your election, the Elastic License 2.0 or the Server
 * Side Public License, v 1.
 */
package org.elasticsearch.plugin.scanner;
import org.elasticsearch.core.PathUtils;
import org.objectweb.asm.ClassReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.UncheckedIOException;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Collections;