Fix complete-when-gzip race bug