Update redis_db.js

Rewrote the socket check.