Yet another pair of file handle leaks

Come on guys, this is getting ridiculous. Every new release we get another one of these leaks. This is trivial stuff: never open a file without a try block that ensures it will be closed.

Code reviewers: this is the first thing you should look for when reviewing code that does IO.