Mitigate SIR epidemic spreading via contact blocking in temporal networks