Qantas returned to profit with a record $1.34 billion underlying earnings result despite years of losses during the pandemic.