Change the capture() context manager to tee output.