Association between bacterial vaginosis or chlamydial infection and miscarriage before 16 weeks' gestation: prospective community based cohort study