Merge "Explicitly flush compress/encrypt stream before close" into nyc-mr1-dev