switch how locals are applied to template metaclass - an optimization

This switches to only calling `class_eval` once while applying the
locals instead of calling it once for every local.

This is just a minor optimization - no behavior changes.  I noticed
this while researching the same concerns for deas-erubis logic.