helper-functions.sh: sync with multiprocessing.eclass

This pulls in (among other thing) portability fixes.

URL: https://bugs.gentoo.org/487056