GEOS-6692

This is a patch and unit test for: http://jira.codehaus.org/browse/GEOS-6692
Please apply to 2.6.x branch. 
Note that this patch only affects the code path involved in multidimensional output, so regular WCS should not be impacted.