Palladium-promoted cyclization of diphenyl ether, diphenylamine, and related compounds