Update daemon.py

Daemon.restart:
Before stopping check if the daemon is active.