Mid-infrared microlensing of accretion disc and dusty torus in quasars: effects on flux ratio anomalies