Protection for single phase inverters