Handle spurious InterruptedException thrown by gradle.