helper-functions.sh: sync with multiprocessing.eclass

This pulls in (among other thing) portability fixes.

URL: https://bugs.gentoo.org/487056
movefile: simplify xattr fallback logic

The "with open()" construct handles exceptions just fine.
tests: add assertExists/assertNotExists helpers

This makes it easy to assert the state of paths and when things fail,
get a good error message in the process (without having to dig into
temp dirs by hand).

This has largely been cribbed from ChromiumOS's chromite module.
fix typo causing a "os" is not defined test error.