add a __bashpid helper for <bash-4.0 versions

The $BASHPID variable is new to bash-4.0, so we need to add fallback logic
to support older versions (notably, bash-3.2).

Reported-by: Ryan Hill <dirtyepic@gentoo.org>
6 files changed