Transductive Active Learning with Application to Safe Bayesian Optimization