Add symmetrical assertion to track c->reply_buffer infinite growth.
Add symmetrical assertion to track c->reply_buffer infinite growth.

Redis clients need to have an instantaneous idea of the amount of memory
they are consuming (if the number is not exact should at least be
proportional to the actual memory usage). We do that adding and
subtracting the SDS length when pushing / popping from the client->reply
list. However it is quite simple to add bugs in such a setup, by not
taking the objects in the list and the count in sync. For such reason,
Redis has an assertion to track counts near 2^64: those are always the
result of the counter wrapping around because we subtract more than we
add. This commit adds the symmetrical assertion: when the list is empty
since we sent everything, the reply_bytes count should be zero. Thanks
to the new assertion it should be simple to also detect the other
problem, where the count slowly increases because of over-counting.
The assertion adds a conditional in the code that sends the buffer to
the socket but should not create any measurable performance slowdown,
listLength() just accesses a structure field, and this code path is
totally dominated by write(2).

Related to #4100.

Sciumo/redis,spinlock/redis,PKRoma/redis,GitHubMota/redis,antirez/redis,nnog/redis,ofirluzon/redis,oranagra/redis,neomantra/redis,PKRoma/redis,soloestoy/redis,PKRoma/redis,soveran/redis,charsyam/redis,charsyam/redis,spinlock/redis,ctripcorp/redis,soloestoy/redis,neomantra/redis,Sciumo/redis,pmem/redis,nnog/redis,charsyam/redis,rogerchina/redis,neomantra/redis,PKRoma/redis,yossigo/redis,ofirluzon/redis,nnog/redis,soveran/redis,spinlock/redis,GitHubMota/redis,Sciumo/redis,pmem/redis,soloestoy/redis,antirez/redis,oranagra/redis,ofirluzon/redis,spinlock/redis,oranagra/redis,neomantra/redis,nnog/redis,ofirluzon/redis,charsyam/redis,yossigo/redis,antirez/redis,rogerchina/redis,Sciumo/redis,charsyam/redis,soveran/redis,yossigo/redis,rogerchina/redis,soloestoy/redis,ctripcorp/redis,oranagra/redis,GitHubMota/redis,antirez/redis,ctripcorp/redis,neomantra/redis,PKRoma/redis,oranagra/redis,soveran/redis,ctripcorp/redis,yossigo/redis,pmem/redis,rogerchina/redis,GitHubMota/redis,soloestoy/redis,ofirluzon/redis,pmem/redis,yossigo/redis