git-fetch-pack: close output fd after dup'ing the input