Add some sleeps when restarting daemons and checking for them. Fixes #270.