NAIROBI, Kenya — When the first batch of African Union peacekeepers landed at Mogadishu’s decrepit airport in 2007, they were immediately shelled by insurgents with mortars and given little chance of success. This was Somalia after all, the graveyard of several other doomed interventions, and the African Union soldiers were a last resort for a deeply troubled mission.