The compound piston: resolution of a thermodynamic controversy by means of kinetic theory