tests: update pack tests to clear out pyc files more completely.
When the test test_curtin_help_has_hacked_version was first written,
the file .pyc file that was known to be created for
my_path/my.py was my_path/my.pyc
Newer versions of python (at least in cpython 3.6), create:
version/__pycache__/version.cpython-36.pyc
This updates the test to remote those pyc files also.
The failure to remove the .pyc file results in a race condition
where sometimes the .pyc file is seen as valid even though the
.py file was written after it.
pack: fix packing when curtin is installed inside a snap.
When curtin is installed as part of a MAAS snap, then it would fail
to find its helpers directory. That is because instead of helpers
living in usr/lib/curtin/helpers they will be in
/snap/maas/<version>/usr/lib/curtin/helpers
But helpfully, SNAP will be set in the environment to point to
/snap/maas/<version>/
The fix is to adjust pack to trust the environment variable
and pack up the installed files based on that prefix.