Medical conditions and the risk of subsequent major depressive disorder: a nationwide, register-based, retrospective cohort study