Make worker wait for stdio streams to close