Export TERM=dumb when detecting Gradle config

fix buggy travis-ci/travis-build#241
ref travis-ci/travis-ci#2275