Pipe leak

Here are fixes for tests that create pipes using `<pipe>` but does not close them afterwards.