Ensure the connection is closed.