Determine auth URLs more intelligently

When dealing with non-github repos that failed authentication's possible to get badly formed URLs after setting username/password.

Take the URL `http://garoevans@example.com/vendor/package.git` for example.

After adding a username password composer tries to clone from `http://garoevans:**********@garoevans@example.com/vendor/package.git`

The changes strip any auth details from the start of the URL and set the found username as the default if one isn't set.