workaround a bug in bash 4.2: trap handlers are not called in 'subshell1 | subshell2' construct

For example in:

 { trap "echo EXIT handler called" EXIT; echo done; } | cat

the exit handler is not called. To fix it, I had to do instead:

 ( trap "echo EXIT handler called" EXIT; echo done; ) | cat