Ofgem says it wants to help energy firms be more resilient and better protect consumers if they do fail.