What was airpower’s ultimate contribution to these battles?

At Dien Bien Phu primarily it was logistical. The Viet Minh were careful not to attack the French in broad daylight, choosing instead to attack at dusk and fighting through the night, thus mitigating the effects of French close air support. By employing their anti-aircraft assets closer and closer to the airfield, the Viet Minh shut it down, forcing the French garrison to rely on airdrops. With a shrinking perimeter and drops from higher altitudes fewer supplies reached the French troops, although Giap’s forces certainly benefited from many miss-drops.

At Khe Sahn tactical air was certainly a force multiplier, as was the strategic employment of air strikes against the PAVN supply routes (which the French employed too little effort to at DBP), but the “air bridge” of supplies was also key, and the PAVN were never able to completely shut down the airfield.
Regardless, in both cases, the combat was predominantly infantry fighting hand-to-hand on hilltops around the posts.

So what do the air power lessons of Dien Bien Phu and Khe Sanh have to do with our present COIN operations in Afghanistan (and Iraq): In my opinion pretty much nothing. Both were battles fought in sparsely populated areas where non-combatant casualties where of no real concern.

Dunlap does correctly discern that the Taliban’s tactics are so designed that “they will achieve a tremendous victory on the battlefield of public opinion.”

Exactly, this is why COIN operations are as much political as they are military. John Paul Vann in Vietnam observed: “This is a political war and it calls for discrimination in killing. The best weapon for killing would be a knife, but I’m afraid we can’t do it that way. The worst is an airplane. The next worse is artillery. Barring a knife, the best is a rifle — you know who you’re killing.”

The Air Force’s contribution to COIN is predominantly in the ISR realm (and logistical) and is certainly invaluable. Tactical air has its use as well, but must be employed very judiciously in order to avoid any non-combatant injuries.

Ultimately, by using examples of set piece battles in arguing his case for airpower’s use in COIN, Dunlap is metaphorically comparing apples to oranges.