GEOS-5533: fixed critical bug in FreemarkerTemplateResource

Hi,

I've made a patch for this issue: 
https://jira.codehaus.org/browse/GEOS-5533