Transition from growth to decay of an epidemic due to lockdown