Redirect std file descriptors properly.