Fix for GRAILS-10403

Note - I have not been able to test that this works.  If I download latest grails-data-mapping and do "gradlew test" I am getting an unrelated error:

Could not resolve all dependencies for configuration ':grails-datastore-core:com
pile'.
> Artifact 'org.slf4j:slf4j-api:1.7.2@jar' not found.

Happy to rework the code if you find issues, just let me know...