restore stdout / stderr in shutdown sequence