pothos-python: fix unit test fail when stdio pipe closed