AOF loading: split handling of format errors from unexpected EOF.
Test AOF format error detection.
AOF ability to load truncated files.
Correct cleanup when aborting AOF loading.

Because of the new ability to start with a truncated AOF, we need
to correctly release all the memory on EOF error. Otherwise there is a
small leak, that is not really a problem, but causes a false positive in
the tests that detect memory leaks.
Make aof-load-truncated option actually configurable.
AOF tests fixed turning aof-load-truncated to no.

When aof-load-truncated option was introduced, with a default of "yes",
the past behavior of the server to abort with trunncated AOF changed, so
we need to explicitly configure the tests to abort with truncated AOF
by setting the option to no.
Tests for aof-load-truncated = yes.
Limit the *SCAN command `dictScan` iterations

*SCAN will cause redis server to hang for seconds
after millions of keys was deleted by SCAN/DEL pairs
Merge pull request #1993 from xiaost/limit-scan-iter-count

Limit the *SCAN command `dictScan` iterations
luaRedisGenericCommand() cached argv handling simplified.

As discussed in issue #1945.
Sentinel: fix computation of total number of votes.

The code to check the number of voters was never updated to follow the new
Sentinel specification, so the number of voters was computed using only
the set of Sentinels that provided a vote.

This means that there is a changing majority on partitions, even if
usually the issue is not triggered because of the configured quorum
check (what was broken was the other implicit check that requires anyway
half of the known sentinels to agree in order to start a failover).
Sentinel sentinelGetLeader() top comment improved.
Cluster test: unit 08, update messages.
Cluster test: unit 09, Pub/Sub across the cluster.
Don't propagate SAVE.

This is a general fix (check that dirty delta is positive) but actually
should have as the only effect fixing the SAVE propagation to
AOF and slaves.
On AOF end of file, truncate the AOF to last valid command.

Recently we introduced the ability to load truncated AOFs, but
unfortuantely the support was broken since the server, after loading the
truncated AOF, continues appending to the file that is corrupted at the
end. The problem is fixed only in the next AOF rewrite.

This commit fixes the issue by truncating the AOF to the last valid
opcode, and aborting if it is not possible to truncate the file
correctly.
Seek at the end of AOF after truncate call.

It is not clear if files open in append only mode will automatically fix
their offset after a truncate(2) operation. This commit makes sure that
we reposition the AOF file descriptor offset at the end of the file
after a truncated AOF is loaded and trimmed to the last valid command.
Better truncated AOF loading tests.

Now there are tests to write more data after loading a truncated AOF,
testing that the loaded data is correct, appending more, and testing
again.
Cluster: new option to work with partial slots coverage.
Cluster: claim ping_sent time even if we can't connect.

This fixes a potential bug that was never observed in practice since
what happens is that the asynchronous connect returns ok (to fail later,
calling the handler) every time, so a ping is queued, and sent_ping
happens to always be populated.

Howver technically connect(2) with a non blocking socket may return an
error synchronously, so before this fix the code was not correct.