Avoid infinite loop when default auth fails with a CURL-based connection

https://karelia.fogbugz.com/f/cases/248882/