Make sure that 2nd close has no effect and operations on closed streams are handled properly.
This test just tests that the basic functions/methods can be called with the appropriate arguments. There is no real test of underlying functionality. Thanks to @hosaka for the initial implementation of this test.