magit-{git-dir,toplevel,expand-git-file-name}: add LOCALNAME arg
fix stashing in repositories accessed using tramp

Tramp does not support setting the environment for a single process,
but we need that to set GIT_INDEX_FILE when stashing and in some other
places.

So add a new variable `magit-tramp-process-environment' and advice
`tramp-sh-handle-start-file-process' and `tramp-sh-handle-process-file'
to inject the variables into the command executed on the remote.

Adapt `magit-with-temp-index' to take advantage of this.