Check if global discovery was actually started before trying to stop it (fixes #653)