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.
SCRIPT FLUSH comment minor pedantic improvement.
Force propagation of SCRIPT LOAD to AOF.
Test: replication-3 test speedup in master-slave setup.
Test: randomInt() behavior commented.
Test: EVALSHA replication.
Flush the replication script cache after SCRIPT FLUSH.
Test: add some AOF testing to EVALSHA replication test.
Don't disconnect pre PSYNC replication clients for timeout.

Clients using SYNC to replicate are older implementations, such as
redis-cli --slave, and are not designed to acknowledge the master with
REPLCONF ACK commands, so we don't have any feedback and should not
disconnect them on timeout.
Merge pull request #1111 from yamt/netbsd3

netbsd support
function renamed: popcount_binary -> redisPopcount.
Allow SHUTDOWN in loading state.
ae.c event loop: API to resize the fd set size on the run.
CONFIG SET maxclients.
getAbsolutePath() moved into utils.c
pathIsBaseName() added to utils.c

The function is used to test that the specified string looks like just
as the basename of a path, without any absolute or relative path.