backend: run_cmd() to dump stderr for code != 0 without check
We experienced some disk-limit, causing the appstream-builder failures
(see the PR#2358 for the discussion). So we applied a work-around and
ignored the exit code (run_cmd() check=False) for a while. Then we
realized the stderr output is actually never dumped to the logs so
nobody can ever notice the error.
This commit assures that the stderr output is either printed to log
(logger is not None), or at least into the exception message (when
check=True). The third option - "logger=None and not check" - the
run_cmd() caller needs to handle the returnvalue.stderr explicitly.
Merges: #2365