Do not use Cargo.lock during cargo build.

* Save Cargo.lock before calling cargo, and restore it after the run.
* Use the --use-cargo-lock flag if the latest dependent crates failed
  to build the current crate. In this case, the published Cargo.lock
  will be used, but the generated .bp might not work with the other
  latest dependent crates in external/rust/crates.
* Fix one gpylint warning.

Bug: 172016745
Test: run through all external/rust/crates/*
Change-Id: I1874a706ac15b74c1dd5a606983b107284d9b28a
1 file changed