fn apply_redirect(redirect: &Redirect, data: &[u8])
Write captured output to a file (truncate or append).