Handle updates to version requirements in lockfiles

This is the same as the fix for #951 (fixed by #965). The relevant code was
erroneously looking at the source id when it should instead look at the entire
package id (name/version/source).
Don't abort on possibly-corrupt submodules

If a submodule's head commit doesn't exist, then we should attempt to update it
rather than aborting the updating process. This commit moves a local `try!` into
a `and_then` closure to prevent returning from the outer function to hopefully
catch more cases where the submodule needs to be updated.

cc #993, but I'm not sure if this fixes it
auto merge of #997 : alexcrichton/cargo/issue-993-attempt, r=brson

If a submodule's head commit doesn't exist, then we should attempt to update it
rather than aborting the updating process. This commit moves a local `try!` into
a `and_then` closure to prevent returning from the outer function to hopefully
catch more cases where the submodule needs to be updated.

cc #993, but I'm not sure if this fixes it
auto merge of #990 : alexcrichton/cargo/update-blows-up, r=brson

This is the same as the fix for #951 (fixed by #965). The relevant code was
erroneously looking at the source id when it should instead look at the entire
package id (name/version/source).
custom_build: add the HOST environment variable