fix randstring bug
don't define _XOPEN_SOURCE for NetBSD

on NetBSD, defining _XOPEN_SOURCE hides extensions
like inet_aton, strcasecmp, etc.
rename popcount to popcount_binary to avoid a conflict with NetBSD libc

NetBSD-current's libc has a function named popcount.
hiding these extensions using feature macros is not possible because
redis uses other extensions covered by the same feature macro.
eg. inet_aton
use nanosleep instead of usleep

SUSv3 says that:
	The useconds argument shall be less than one million. If the value of
	useconds is 0, then the call has no effect.
and actually NetBSD's implementation rejects such a value with EINVAL.
use nanosleep which has no such a limitation instead.
don't assume time_t == long

time_t is always 64bit on recent versions of NetBSD.
Try to report source of bad Lua API calls
REPLCONF ACK command.

This special command is used by the slave to inform the master the
amount of replication stream it currently consumed.

it does not return anything so that we not need to consume additional
bandwidth needed by the master to reply something.

The master can do a number of things knowing the amount of stream
processed, such as understanding the "lag" in bytes of the slave, verify
if a given command was already processed by the slave, and so forth.
Replication: send REPLCONF ACK to master.
Make sure that REPLCONF ACK really has no return value.
Don't ACK the master after every command.

Sending an ACK is now moved into the replicationSendAck() function.
Send ACK to master once every second.

ACKs can be also used as a base for synchronous replication. However in
that case they'll be explicitly requested by the master when the client
sends a request that needs to be replicated synchronously.
Close connection with timedout slaves.

Now masters, using the time at which the last REPLCONF ACK was received,
are able to explicitly disconnect slaves that are no longer responding.

Previously the only chance was to see a very long output buffer, that
was highly suboptimal.
redis.conf updated: repl-timeout now uesd by masters as well.
Version bumped to 2.9.11
A comment about BLPOP timeout did not reflected actual behavior.
Accept REPLCONF in any state.
Slaves list in INFO output: lag added, format changed.

There is a new 'lag' information in the list of slaves, in the
"replication" section of the INFO output.

Also the format was changed in a backward incompatible way in order to
make it more easy to parse if new fields are added in the future, as the
new format is comma separated but has named fields (no longer positional
fields).
repl_offset field in INFO replication is now just offset.
min-slaves-to-write: initial description of the feature in redis.conf
min-slaves-to-write: don't accept writes with less than N replicas.

This feature allows the user to specify the minimum number of
connected replicas having a lag less or equal than the specified
amount of seconds for writes to be accepted.