Treasury and five major airlines finalize loan terms