A Distributed Bayesian Approach to Fault Detection in Sensor Networks