Cover-actuated safety switch, which discharges the capacitor and disconnects the primary source when the cover is removed