Added checks for disconnected state on connection object before attempting to destroy it (after tests).