revised fixes for JLine 2.7 support

these work with the standard build but not with build-opt
due to a bug in the Scala optimizer

https://issues.scala-lang.org/browse/SI-5322