parallel-tests: reimplement fix for bug#11791
* lib/am/check.am: Here. The new implementation is shorter, slightly
more efficient (requiring less forks), less brittle in the face of
signals or unexpected interruptions in the make process, and should
also be easier to merge in the 'ng/master' branch (as of now, due to
the difficulties in merging our previous version of the fix in the
'ng/master' codebase, Automake-NG still lacks a fix for bug#11791).
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>