(#11276) Tarball entries should be relative to the `pkg` directory

Commit 94f2f0a9 removed the call to `Dir.chdir`, which is necessary so
that entries in the tarball are relative to the `pkg` directory, i.e.
each entry starts with the metadata release_name, which is of the form:

    myuser-mydir-X.Y.Z/

This issue was caught by the `loadable_from_modules` acceptance test as
the newly installed module did not install its metadata in the expected
locations.

This commit restores the `Dir.chdir` behavior and updates the test.
Merge branch 'joshcooper-ticket/master/11276-chdir-fix'

* joshcooper-ticket/master/11276-chdir-fix:
  (#11276) Tarball entries should be relative to the `pkg` directory

closes #1603