Pilots at United Airlines approved a new contract that includes pay raises of as much as 40% over the course of its four-year term.