Added check for scanning before start/stop CastDiscoveryProvider