Close jline 3 terminal when console exits
Close jline 3 terminal when console exits

The jline 3 Terminal is an autocloseable and should be closed when we're
down with it. I'm not exactly sure what resources we were potentially
leaking, but the jline3term variable is an instance of the jline
AbstractTerminal class which I know can create a thread in some
circumstances. This came up while working on #6185.

sbt/sbt,mdedetrich/sbt,sbt/sbt,xuwei-k/xsbt,mdedetrich/sbt,xuwei-k/xsbt,sbt/sbt,xuwei-k/xsbt,sbt/sbt,mdedetrich/sbt,xuwei-k/xsbt,mdedetrich/sbt,xuwei-k/xsbt,sbt/sbt,mdedetrich/sbt,mdedetrich/sbt,mdedetrich/sbt,sbt/sbt,sbt/sbt