Thermal power plant upgrade via a rotating detonation combustor and retrofitted turbine with optimized endwalls