GROOVY-5370: ConfigSlurper - multiple environment blocks broken

All credit for the patch and tests to Richard Rattigan