High-Probability Bounds for Stochastic Optimization and Variational Inequalities: the Case of Unbounded Variance