daemon: truncate the pidfile when we're waiting to restart child
We need to be able to test some more restart behavior that depends on
knowing specifically where we're at (inside the event loop or outside of
the event loop). Truncate the pidfile until the process is restarted to
give the test a clean marker rather than having to add arbitrary delays
and hoping for the best.
Reviewed by: des, markj
(cherry picked from commit aa8722cc18e4620ea5e7b0a4917207ed1508393d)