Taking certain types of antibiotics during pregnancy may boost the risk of miscarriage, a large study suggests.