Thermodynamics of a collapsing shell in an expanding universe