executor: Do not deadlock on writing logs
Created by: efritz
The ctx
here is used below as a guard against the command finishing before we close the stdout and stderr pipes. This context may never be canceled, so we enforce a cancellation of a child context at function exit.