xargs: fix exit code when using -P
currently when xargs runs in parallel mode (e.g. -P2), it somtimes
incorrectly returns zero exit code. this commit fix it and also adds
tests.
Reviewed by: mjg
PR: 267110
(cherry picked from commit 0ca740d9a639ab635f5a28be9051d0124a9544a1)