(PUP-2278) Parameterize the mode of Puppet::Util::Execution.execpipe.

In the previous commit, the default behavior of `execpipe` was changed
to ensure that the pipe was always opened in read/write mode.  While we
aren't aware of any regressions this change would cause, the cautious
route is to maintain the same default behavior for now; to that end,
this commit adds a `mode` parameter to `execpipe`, allowing callers to
choose the mode the pipe is opened in.