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.

backport of 8e75fd2d2921b3908864aff4b714e26e6791d0a6