Add Daemon restart test along with Daemon utils

This PR allows writing tests that need a daemon restart.
There is also a very useful test case that can also serve as an example on how to use it.

Ping @unclejack @tianon @vieux
@tianon I don't think it matters that much that it's Seconds based, since startup and shutdown takes more than a second. We just need to make sure we don't run those in parallel in the future. Another solution would be to append a random number instead.