Fix external command pipe: Too many open files

fixes #6916