a. A single-minded and uncompromising campaign against a group of people with unacceptable views or behaviour, spec. communists; esp. one regarded as unfair or malicious persecution.
b. A campaign against an individual.
It has taken on this less literal meaning since the 1930s. The term is used to mean that a group of people is being persecuted for their beliefs unfairly. This can be used when there is a potential problem or not, but the group of "witches" is not being treated fairly. I think it is safe to say that the term applies to both of your cases: when there is no problem (like the Salem Witch Trials) and when due process is ignored (like communists in the US).
1. English language and usage, (2011) Does the term “witch-hunt” apply when referring to dealing with a real problem? Retrieved from http://english.stackexchange.com/questions/40663/does-the-term-witch-hunt-apply-when-referring-to-dealing-with-a-real-problem