Close leaking input streams

@huwr, here's a few more missing a closes.