prevent possible indefinite HTTP request loop

- when Gerrit returns HTTP status code 401, the client sends the same credentials forever
- Gerrit returns 401 for example in case of unavailable database
- now the same credentials are just sent once per request