Stereocontrol in the intramolecular Buchner reaction of diazoamides and diazoesters