added options to close stdout/stderr in the child