Detect correctly if the daemon has stopped