Catalysis with inorganic cations. III. The effect of perchlorates on the competition between intramolecular hetero-Diels-Alder and ene reactions