Added asserts on socket close in test_conenct_rid.