Synthesis of cyclic peptides via O–N-acyl migration