Fix failure on second run of 'cargo test'

Generate the right target filename for rlibs built in test
mode so that they are correctly moved back out of the old-root
directory.
Add regression test for running `cargo test` twice
auto merge of #232 : bkoropoff/cargo/fix-repeated-cargo-test, r=alexcrichton

Generate the right target filename for rlibs built in test
mode so that they are correctly moved back out of the old-root
directory.