On a stochastic logistic population model with time-varying carrying capacity