Devices for humidifying or heating the inspired gas by using recovered moisture or heat from the expired gas