Jet-engine maker United Technologies agreed to buy Rockwell Collins for $30 billion, the companies said.