use tempdir instead of tempname in test/pkg.jl

since tempname creates a file on windows, but the goal here is creating
a directory. also don't try to delete nonexistent files during cleanup
Merge pull request #9112 from JuliaLang/tk/fix-pkg-testdir

use tempdir instead of tempname in test/pkg.jl