Gradle: fix issue with Gradle Tooling API classpath inferer