Don't fail `cargo login` if `~/.cargo` doesn't exist

Closes #927
Clean up code around the crawling of a directory

The logic for "not recursing into `target`" was pretty hokey and needed
replacement. This commit also unfies the paths a bit to ensure that the main
loop is the same part that adds the root package itself.

This reorganization ends up closing #937
auto merge of #941 : alexcrichton/cargo/issue-927, r=brson

Closes #927
auto merge of #947 : alexcrichton/cargo/issue-937, r=brson

The logic for "not recursing into `target`" was pretty hokey and needed
replacement. This commit also unfies the paths a bit to ensure that the main
loop is the same part that adds the root package itself.

This reorganization ends up closing #937
Merge remote-tracking branch 'upstream/master'