Military mutineers said that they had ousted the country’s elected leader. The move shakes a pillar of democracy in West Africa.