Auto merge of #6681 - hmarr:master, r=alexcrichton
Auto merge of #6681 - hmarr:master, r=alexcrichton

Don't retry invalid credentials from git credential helpers

If a git credential helper returns invalid credentials, we currently get stuck in an infinite retry loop by calling the credentials callback over and over, each time returning the same invalid credentials. This change means we only invoke the credential helper once.

## How to reproduce

1. Create a git credential store with some invalid credentials:

```
echo "https://example-user:invalid-credentials@github.com" > ~/invalid-store
```

2. Tell git to use that as your credential store by adding this to your `~/.gitconfig`:

```
[credential]
	helper = store --file=/home/<user>/invalid-store
```

3. Add an invalid Git dependency to a `Cargo.toml`. For instance:

```
[dependencies.fake-repository]
git = "https://github.com/fake-user/fake-repository"
version = ">= 1.0.0"
```

4. Try to update the dependencies (e.g. with `cargo update` or `cargo build`).

Cargo hangs forever, retrying the invalid credentials.

vojtechkral/cargo,tsurai/cargo,rust-lang/cargo,eminence/cargo,vojtechkral/cargo,vojtechkral/cargo,tsurai/cargo,tshepang/cargo,tsurai/cargo,rustyhorde/cargo,eminence/cargo,nipunn1313/cargo,nipunn1313/cargo,tshepang/cargo,rustyhorde/cargo,tshepang/cargo,rustyhorde/cargo,vojtechkral/cargo,nipunn1313/cargo,tshepang/cargo,tsurai/cargo,rustyhorde/cargo,eminence/cargo,tsurai/cargo,rust-lang/cargo,rust-lang/cargo,eminence/cargo,rust-lang/cargo,nipunn1313/cargo