Causal Bayesian Networks for Data-driven Safety Analysis of Complex Systems