Fix a zipmap parsing bug

The zipmap entries allow to dynamically update the values, but not the
keys. The 'Free' entry may only be present before the value, not the
key.

This patch fixes the zipmap entry parsing so that it is aware of what is
a key and what is a value, rather than assuming they are uniform.
fix ziplist endianness bug

Ziplists with lengths greater than 63 bytes and up to 16383 bytes appear
not to be encoded as small endian like the rest. The original source at
https://github.com/sripathikrishnan/redis-rdb-tools/blob/master/docs/RDB_File_Format.textile
doesn't mention the endianness, so 'native' is being used. This will
default to 'big' on most architectures, maybe implode on clusters with
varying endianness.

The patch also includes a fix for an explicitly big endian format for
String values with length greater than or equal to 16384 bytes, as
showin at
https://github.com/sripathikrishnan/redis-rdb-tools/commit/4a4b7e073aae64a5ec96dc461a25983843f09ea1
in the original project.
Adding long heartbeat timeouts on connections

Redis will send a ping message roughly every 10 seconds, although this
feature appears undocumented. There have been cases where the connection
seems entirely blocked for no reason, which should prompt a reconnection
and a new sync.

This patch adds a heartbeat with a minute-long delay that will close the
connection and restart it, and ask to sync again if the server doesn't
answer to a PING command (with "+PONG\r\n") in the next minute.
Merge pull request #10 from ferd/joey-fatone

Fix RDB, add heartbeats.