Mali’s president said Wednesday he had resigned to avoid “bloodshed” after he was detained in a military coup, whose leaders pledged new elections to resolve…