Adaptive density estimation by Bayesian averaging