Fix groovysh test

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