Fix some bugs with `cargo test` twice

These are both related to destroying the build directory and then recreating it.