fix for GRAILS-10538 "Unit test of service doesn't work with @Transactional annotation"
use traps to reset bash shell state