(PUP-3248) Use tmpdir for generating environments

This commit changes calls to the
generate_base_legacy_and_directory_environments helper to use a
tmpdir rather than master['puppetpath'] to isolate the test
environments and prevent collisions.

The generate_base_legacy_and_directory_environments has also been
altered to append the given path to the `environmentpath` setting
in the generated configuration file.