Functions of noncommuting self-adjoint operators under perturbation and estimates of triple operator integrals