Thermodynamic descriptions of polytropic gas and its viscous type as dark energy candidates