Arrangements for cooling or ventilating wherein gaseous cooling medium circulates between the machine casing and a surrounding mantle wherein the external part of the closed circuit comprises a heat exchanger structurally associated with the machine casing