Thermal conductivity of diatomic gases: Liquid and gaseous states