Proof of a modular relation between 1-, 2- and 3-loop Feynman diagrams on a torus