The influence of pregnancy termination on the outcome of subsequent pregnancies: a retrospective cohort study