Fix issue: 'len' referenced before assignment

The error caused by the built-in function `len` used in the
new-added code in #124.

Changed the original `len` variable to `msglen` to avoid name
conflict.
Merge pull request #125 from moonranger/redis-fix-len-error

Fix issue: 'len' referenced before assignment