closing various streams

hopefully this will help to get our tests working on windows