The U.S. Air Force’s E-7 Wedgetail jet program ​seemed doomed by delays and rising costs—until Congress stepped in.