GRAILS-9804

- added toDetachedCriteria method to NamedCriteriaProxy
- added test case