Use try-finally idiom with TokenStreams

Shown to be a problem after an error gets thrown that doesn't close the tokenstream.