Functions of perturbed tuples of self-adjoint operators