Always close input/output streams.
Improves test: checks that URLs inside transformed HTML exist in metadata and that streams are closed.