fix packages being uninstalled / reinstalled when running Pkg.test  with REQUIRES

hopefully fixes https://github.com/JuliaLang/julia/issues/7967

Edit: This uninstalls test requirements after the tests are finished which is probably not the desired behavior.  What is the desired behavior exactly?  I'm assuming that we want to permanently install the test dependencies only when the tests run.  I'll modify the behavior tomorrow if this is the case.