Closing the logger is usually the last operation that will be run and at
this point, we don't have a good way to report errors, and it's also too
late to act on them. Thus ignore those errors.
Fixes lint:
```
Error return value of `l.ops.Close` is not checked (errcheck)
```
The linter found staticcheck and errorcheck issues. Deferred statements now use join to combine any new error with an existing one, preventing error information from being lost. Other minor error checks, like for printing text and flushing data have also been addressed.
For inspecting how a command failed it can be useful to inspect the exit
code of the command. This commit modifies the LogCmd command to return
the command's exit code in addition to any errors. -1 if some error was
encountered and there is no exit code.
Some call sites are doing this ad-hoc inconsistently, just always log
this when there's an error, with the error, full command line, stdout,
and stderr nicely ordered.