Gaussian approximation of maxima of Wiener functionals and its application to high-frequency data