Ericsson-type engines having open regenerative cycles controlled by valves