Synthesis of Benzofurans and Benzoxazoles through a [3,3]-Sigmatropic Rearrangement: O–NHAc as a Multitasking Functional Group