Ensure no group_leader leakage on capture_io and remove stderr test which was printing on run
Remove unused variable
Also allow explicitly capturing of stdio and stderr