in reply to STDERR Restore after redirect

You've already received some excellent answers.

In case it's of use Re: Reading output of external program without Shell contains some working sample code that saves and restores STDOUT and STDERR.