tests: add more checks to detect issues when executing shell commands
tests: add more checks to detect issues when executing shell commands

To detect that the child process segfaulted (known bug in glibc's fork()),
use WIFEXITED() instead of just looking into the output of the process
(which had some false negatives and the test later failed).

morganzhh/sysrepo,morganzhh/sysrepo,morganzhh/sysrepo,morganzhh/sysrepo,morganzhh/sysrepo,morganzhh/sysrepo,morganzhh/sysrepo