Wasn't closing stdin, stdout, stderr.