Sleep instead of waiting for signal in daemon

The daemon needs to periodically check if the server is still running
so it can exit cleanly instead of waiting for a signal.

Change-Id: I20935773518653916f8ed7d5d3734f7b9e478998
Merge "Sleep instead of waiting for signal in daemon"