Process for the alpha-methylation of esters and lactones