Close the redis connection reliably.