submodule: Fix memory leaks
tests: Fix memory leak
Merge pull request #1725 from libgit2/ntk/fix/leaks

Plug some memory leaks