Make sure subprocess patch gets closed