Improve logging for wfShellExec() and ignore missing cgroup
Allow limit.sh to log its errors to an MW debug log channel, by opening
a separate FD for private communication.
Ensure that the log FD is always closed (3>&-) before executing a
subprocess, so that MW will not hang waiting for background processes
to close the log FD. This means using a fixed FD number, since the bash
syntax for closing a file requires a literal FD number.
The "exec" debug channel is now intended for production monitoring. In
addition to errors from limit.sh, it also records when a subprocess is
terminated by a signal.
The case where stream_select() returns false was tested by patching PHP
to inject EINTR or EBADF into errno.
When wfShellExec() is used with a memory cgroup, and the cgroup is missing, log and continue with no cgroup instead of immediately exiting.
Bug: 55709
Change-Id: Ie40befe9c0d00c9a0ddb01077df4afb774d17e15