Does the term "witch-hunt" apply when referring to dealing with a real problem?
Should the term "witch hunt" only be used when dealing with a problem that does not exist, as in witchcraft, or does the term also apply when a problem does exist, but those dealing with it are ignoring due process?
The definition for witch-hunt, as given by the OED, is:
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).
A "witch hunt" implies that someone is blamed for something that is not their fault. The problem may be real. But the source of the problem is not clear so a "scape goat" is found to take the blame.