Time-optimal control problem in the space of probability measures