python redirect stdout and stderr to same file