Fix 'meson subprojects foreach' when command returns non-zero exit code
Fix 'meson subprojects foreach' when command returns non-zero exit code

The 'output' field of the subprocess.CalledProcessError exception is
valid only when subprocess.check_output() is called, trying to access it
after calling subprocess.check_call() results in an unwanted exception
when commands return non-zero exit code, e.g.:

-----------------------------------------------------------------------
$ meson subprojects foreach false
Executing command in ./subprojects/sqlite-amalgamation-3250100
  -> Not downloaded yet
Executing command in ./subprojects/gstreamer
Traceback (most recent call last):
  File "/home/ao2/meson/meson/mesonbuild/msubprojects.py", line 177, in foreach
    subprocess.check_call([options.command] + options.args, cwd=repo_dir)
  File "/usr/lib/python3.7/subprocess.py", line 363, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['false']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ao2/meson/meson/mesonbuild/mesonmain.py", line 129, in run
    return options.run_func(options)
  File "/home/ao2/meson/meson/mesonbuild/msubprojects.py", line 248, in run
    options.subprojects_func(wrap, repo_dir, options)
  File "/home/ao2/meson/meson/mesonbuild/msubprojects.py", line 180, in foreach
    out = e.output.decode().strip()
AttributeError: 'NoneType' object has no attribute 'decode'
-----------------------------------------------------------------------

Use subprocess.check_output() instead and behave more like git commands
in handling stderr.

This makes it possible to actually run commands on all subprojects
allowing them to fail on some subprojects and succeed on others.

Also catch the case of missing commands and print an error message in
this case as well.

jpakkane/meson,pexip/meson,mesonbuild/meson,QuLogic/meson,pexip/meson,jpakkane/meson,becm/meson,mesonbuild/meson,pexip/meson,becm/meson,becm/meson,jpakkane/meson,QuLogic/meson,pexip/meson,QuLogic/meson,mesonbuild/meson,QuLogic/meson,becm/meson,becm/meson,becm/meson,QuLogic/meson,jpakkane/meson,QuLogic/meson,jpakkane/meson,QuLogic/meson,mesonbuild/meson,jpakkane/meson,mesonbuild/meson,becm/meson,QuLogic/meson,becm/meson,mesonbuild/meson,mesonbuild/meson,mesonbuild/meson,pexip/meson,pexip/meson,becm/meson,jpakkane/meson,jpakkane/meson,pexip/meson,mesonbuild/meson,jpakkane/meson,pexip/meson,mesonbuild/meson,QuLogic/meson,pexip/meson,becm/meson,pexip/meson