Soldiers in Niger have announced a coup, imposing a curfew and closing borders in a country that is a key U.S. ally in West Africa.