Improve Redis connection handling