Added test to check socket is closed after disconnect.