Reverse power protection in generator