Army will restore writ in Swat: COAS