ΔS=2 and ΔC=2 bag parameters in the standard model and beyond from Nf=2+1+1 twisted-mass lattice QCD