At the height of the COVID-19 pandemic the outlook for United Airlines and rivals looked bleak.