Stator earth fault protection