Time-optimal control strategies in SIR epidemic models