tests: fix test-runner for osx. Closes ##4708

Use the more portable $$ rather than $BASHPID
Merge pull request #4710

9322f1a tests: fix test-runner for osx. Closes ##4708 (Cory Fields)