Remove most of the `===DONE===` tags and its variations. Keep `===DONE===` if the test output otherwise becomes empty. Closes GH-4872.
We should not open the output stream before we have tried to open the archive entry, as failing the latter could leave an empty file behind.