GROOVY-5801: sql.firstRow() can be incredibly slow

implemented as suggested by Sam Perman

see: https://jira.codehaus.org/browse/GROOVY-5801
Merge pull request #137 from PascalSchumacher/GROOVY-5801

GROOVY-5801: sql.firstRow() can be incredibly slow
GROOVY-5988: Reference to for-loop parameter leads to type "Object" instead of declared type