Use tempname() instead of custom file path in test/pkg.jl

Fixes calling Base.runtests("pkg") when Julia is installed in a
prefix where typical user does not have write access.
Merge pull request #8942 from JuliaLang/nalimilan/tempname

Use tempname() instead of custom file path in test/pkg.jl