Fix groovysh test

Attempt to make tests more robust against mytery problem discussed in https://github.com/groovy/groovy-core/pull/180