Set TERM to 'dumb' when Gradle config is detected

There are following issues with #240 (dfe2bfc):

- Android builder does not export TERM=dumb (common parts are in jdk.rb,
  not jvm.rb)
- TERM=dumb would be exported for all JVM languages, even if not built
  with Gradle.

@BanzaiMan @joshk The first point is mandatory and I think the second one is safer as this is not a general convention for other build tools like Ant, Maven, Leiningen or sbt (the risk to hurt something by always exporting `TERM=dumb` might be quite low, but I have no information on this, hence this safety way)