Allow to specify a line prefix in -o mode

If specified, this prefix is printed on each line of output.
Do not pass argv[0] to run_command() separately

We always pass the entire argv array to run_command(), so there is no
need to also pass argv[0] separately.  (We never use a special argv[0],
either.)
Don't set up a stdin pipe if in_buffer is empty

... in addition to when in_buffer is not defined.  In both cases,
a pipe can only be unnecessary overhead.
Add xstrdup() (based on xstrndup())
Implement internal "onexit" command

Defines a command to run when exxe exits ("onexit command ...") or
removes an existing definition ("onexit -").  Only a single command can
be registered.