Add test for checking that a stream can be reopened.
Merge branch 'reopen_test'. Closes #110.