Handle daemon shutdown

When the daemon is shut down we should make sure to handle running tasks gracefully.
I think it would make sense to kill all running tasks, to also make sure the status us updated accordingly.