In the era of sophisticated long-range air-to-air missiles, cannons on aircraft may seem quaint—but they still serve a vital purpose.