Export command variable assignments to the environment.

In the POSIX sh language, variable assignments preceding a command are
exported to the enviroment of the command. Previously runcmd_open() was
not handling this for simple commands that don't require a subshell to
run (the shell handles this for more complex commands that we run in a
subshell).

These changes export the variable assignments without requiring a
complete subshell.
runcmd: Handle child errors more thoroughly and uniformly.

runcmd_open() was not detecting some error conditions that would result
in the child runtime environment not being established correctly. With
the exception of close(), calls in the newly created child process that
can fail within reason are now checked and reported to stderr before
exiting.
runcmd: Correct comments and cleanup some code.

Corrected comments regarding 'async-safety', code attribution, and code
function. runcmd_init() is definitely NOT reentrant, and incorrectly
calling this function as if it were would invalidate the reentrancy of
the other functions that access the pids global variable.

Moved Doxygen section end (/** @} */) in runcmd.h inside include guard
in order to not confuse Doxygen. Removed unused and incorrect SIG_ERR
define, and one declaration per line.