Arrangements for cooling or ventilating by gaseous cooling medium circulating wholly within the machine casing