Add ConnectionTests.test_unexpected_close()

This test checks that the closed attribute is correctly set after the 
connection is unexpectedly closed