Thermodynamics of emergent magnetic charge screening in artificial spin ice