Distributed Energy Management in Smart Thermal Grids with Uncertain Demands