ExecUtil.pm: support a same-pid reexec option
Ideally when re-execing oneself, one wants to end up with a new
pid to reflect the fact that really a new copy is running and also
to avoid any odd failures caused by the same pid trying to run some
initialization code twice from the same pid without an intervening
pid termination that perhaps the operating system does not tolerate
very well.
However, there are some circumstances where it's very inconvenient
for the original pid to exit, so allow keeping the same pid with
an option and leave it up to the caller in that case to deal with
any operating system idiosyncrasies regarding double initialization.
The old and new pid values are also now passed to the optional
success code ref (which is run in a doubly-forked process when
keeping the same pid to avoid a spurious SIGCHLD in the parent).
Signed-off-by: Kyle J. McKay <mackyle@gmail.com>