util: refactor OpenLog and ReOpenLog
Non-functional changes and cleanups in preparation for fixes and
enhancements.
Move the duplicated code to redirect the stdio/stderr streams to a common
static function. Add a helper function to check for named pipes. Move the
code to rename files when opening logs to a separate static function.
Change-Id: I5b56b80a7e799b6605cfad7b58ac8249ac93acc8
Reviewed-on: https://gerrit.openafs.org/11721
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>