GEOS-5533: fixed critical bug in FreemarkerTemplateResource

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