Polyakov loop and gluon quasiparticles: A self-consistent approach to Yang-Mills thermodynamics