crash_detect: redirect stdout/stdin to files