close process stream after write