Be sure to lock purely optional dependencies

Previously all features were traversed when adding information to the lockfile,
but the traversal forgot to add optional dependencies that did not have a
corresponding feature.

Closes #801
auto merge of #802 : alexcrichton/cargo/issue-801, r=brson

Previously all features were traversed when adding information to the lockfile,
but the traversal forgot to add optional dependencies that did not have a
corresponding feature.

Closes #801