Client should not block multiple times on the same key.
Client should not block multiple times on the same key.

Sending a command like:

BLPOP foo foo foo foo 0

Resulted into a crash before this commit since the client ended being
inserted in the waiting list for this key multiple times.
This resulted into the function handleClientsBlockedOnLists() to fail
because we have code like that:

    if (de) {
        list *clients = dictGetVal(de);
        int numclients = listLength(clients);

        while(numclients--) {
            listNode *clientnode = listFirst(clients);

            /* server clients here... */
        }
    }

The code to serve clients used to remove the served client from the
waiting list, so if a client is blocking multiple times, eventually the
call to listFirst() will return NULL or worse will access random memory
since the list may no longer exist as it is removed by the function
unblockClientWaitingData() if there are no more clients waiting for this
list.

To avoid making the rest of the implementation more complex, this commit
modifies blockForKeys() so that a client will be put just a single time
into the waiting list for a given key.

Since it is Saturday, I hope this fixes issue #801.

jaambee/redis,ideaar/redis,crask/redis-cutter,jaambee/redis,upsoft/redis,miminus/redis,erwin00776/redis-2.8-optimize,jqk6/redis,miminus/redis,liqiang199105/redis,liqiang199105/redis,powerumc/MyRedis,StartTheShift/redis-shift,sidsen/redis,jacklee0810/redis,LittlePeng/redis,jqk6/redis,quangnguyen90/redis,ScottKaiGu/redis,powerumc/MyRedis,richmonkey/netleveldb,ideaar/redis,sidsen/redis,damy/redis,damy/redis,powerumc/MyRedis_old,janeasystems/redis,shanegxxiao/redis,shanegxxiao/redis,erwin00776/redis-2.8-optimize,enginekit/redis,ideaar/redis,sidsen/redis,fanxu/redis,jacklee0810/redis,Jonavin/redis,enginekit/redis,alpha8/redis,Cybermaxs/redis,kolonse/redis,alpha8/redis,sidsen/redis,crask/redis-cutter,fanxu/redis,upsoft/redis,adamweixuan/redis,kolonse/redis,adamweixuan/redis,fanxu/redis,fanxu/redis,damy/redis,adamweixuan/redis,kts12345/redis,miminus/redis,enginekit/redis,miminus/redis,jaambee/redis,oaastest/redis,hanmichael/redis,nandhanurrevanth/redis,Cybermaxs/redis,jacklee0810/redis,quangnguyen90/redis,erwin00776/redis-2.8-optimize,upsoft/redis,ScottKaiGu/redis,erwin00776/redis-2.8-optimize,laurencee/redis,kts12345/redis,LittlePeng/redis,laurencee/redis,Jonavin/redis,Cybermaxs/redis,ideaar/redis,Jonavin/redis,crask/redis-cutter,adamweixuan/redis,damy/redis,miminus/redis,powerumc/MyRedis_old,ScottKaiGu/redis,jqk6/redis,alpha8/redis,liqiang199105/redis,kolonse/redis,janeasystems/redis,hanmichael/redis,laurencee/redis,kolonse/redis,kolonse/redis,quangnguyen90/redis,richmonkey/netleveldb,shanegxxiao/redis,ScottKaiGu/redis,nandhanurrevanth/redis,oaastest/redis,jacklee0810/redis,ScottKaiGu/redis,powerumc/MyRedis,hanmichael/redis,liqiang199105/redis,oaastest/redis,hanmichael/redis,shanegxxiao/redis,jqk6/redis,kts12345/redis,Cybermaxs/redis,Cybermaxs/redis,Jonavin/redis,alpha8/redis,StartTheShift/redis-shift,LittlePeng/redis,laurencee/redis,damy/redis,sidsen/redis,laurencee/redis,richmonkey/netleveldb,kts12345/redis,jaambee/redis,kts12345/redis,hanmichael/redis,adamweixuan/redis,nandhanurrevanth/redis,Jonavin/redis,nandhanurrevanth/redis,sidsen/redis,richmonkey/netleveldb,jqk6/redis,jaambee/redis,upsoft/redis,janeasystems/redis,jacklee0810/redis,alpha8/redis,quangnguyen90/redis,janeasystems/redis,liqiang199105/redis,quangnguyen90/redis,enginekit/redis,nandhanurrevanth/redis,enginekit/redis,powerumc/MyRedis_old,oaastest/redis,janeasystems/redis,upsoft/redis,powerumc/MyRedis_old,oaastest/redis,shanegxxiao/redis,StartTheShift/redis-shift,ideaar/redis