Fixed permissions on template directories.

This should fix issue https://github.com/libgit2/libgit2/issues/2322.