Previous miscarriage and the subsequent risk of preterm birth in Scotland, 1980–2008: a historical cohort study