clone: fix a memory leak of the "git_dir" variable