Senegalese headed to the polls Sunday in a tightly contested presidential race that followed months of uncertainty and unrest that has tested the West African nation’s reputation as a stable democracy in a region that has experienced a wave of coups in recent years.