Static analysis

This is a first batch of things a static analysis tool found. These are failures to close files and streams.
The second .close() needs its own try-catch block, unfortunately. Fortunately, we should have `freenet.support.io.Closer` which reduces the amount of code you have to write yourself for this job.