Fixed a deadlock when the test classpath contains no directories