Allow comments after config directives

Fixes #521
redis-cli: Re-attach selected DB after auth

Previously, if you did SELECT then AUTH, redis-cli
would show your SELECT'd db even though it didn't
happen.

Note: running into this situation is a (hopefully) very limited
used case of people using multiple DBs and AUTH all at the same
time.

Fixes antirez#1639
redis-cli: stop showing incorrectly selected DB

Previously redis-cli would happily show "-1" or "99999"
as valid DB choices.

Now, if the SELECT call returned an error, we don't update
the DB number in the CLI.

Inspired by @anupshendkar in #1313

Fixes #566, #1313
redis-cli: Add --no-raw option

Some people need formatted output even when they have no
interactive tty.

Fixes #760
Add support for compiling on AIX

Closes #1900
Fix key extraction for SORT

We only want to use the last STORE key, but we have to record
we actually found a STORE key so we can increment the final return
key count.

Test added to prevent further regression.

Closes #1883, #1645, #1647
Handle large getrange requests

Previously the end was casted to a smaller type
which resulted in a wrong check and failed
with values larger than handled by unsigned.

Closes #1847, #1844
scripting: no eval with negative key count

Negative key count causes segfault in Lua functions.

Fixes #1842
Closes #1843
cluster: fix node connection memory leak

Cluster leaks memory while connecting due to missing freeaddrinfo()

Closes #1801
redis-cli: fix latency result output

(Cleaned up a little by @mattsta)

Closes #1774
Remove redundant else/return block

Fixes #1741
Fix intset midpoint selection

The classic (min+max)/2 is provably unsafe.  Fixed
as recommended in research:
http://googleresearch.blogspot.com/2006/06/extra-extra-read-all-about-it-nearly.html

Fix inspired by @wjin, but I used a different approach.
(later, I found @kuebler fixed the same issue too).

Fixes #1741, #1602
install_server.sh: add missing bang

This was discovered by _bodya and reported in the IRC channel.
Everything worked fine as these scripts are always executed as shell
scripts.

Closes #1728
Fix assert technical correctness

dictAdd returns DICT_OK, not REDIS_OK. They both
have the same underlying values, so it works even though
the code is technically wrong.

Fixes #1512
Change unixsocketperm comment to 700 from 755

According to unix manuals, "Connecting to the socket object requires
read/write permission." -- mode 755 is useless for anybody
other than the owner.

Fixes #1696
redis-check-dump: use names instead of magic nums

Use constants to avoid magic numbers in `types`, which is an array
that stores the names of `REDIS` types.

Closes #1681
Fix issues raised by clang analyzer

Closes #1660
Add graceful exit when Ctrl-C is received
Factor out duplicate signal handling code

No options are set for SIGTERM, so we can use the simpler
signal handling interface and remove unnecessary structure initilization.

sigemptyset() is moved outside of the ifdef to prevent any potential
unused variable warning.

Closes #1637
Use 'void' for zero-argument functions

According to the C standard,
it is desirable to give the type 'void'
to functions have no argument.

Closes #1631