Set TERM to 'dumb' for JVM builds

On JVM builds, set `TERM` to `dumb`. Fixes travis-ci/travis-ci#2275.