Redirect stdout/stderr when calling external commands.