Fix logic error introduced into group template setup in r7442

Template variables were getting overwritten because of incorrect placement
in the loop.

See #5032

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7453 cdf35c40-ae34-48e0-9cc9-0c9da1808c22