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.

Soledad89/redis,seandsky/redis,supasate/redis,Markgorden/redis,mcanthony/redis,RepmujNetsik/redis,190235047/redis,wuxiaowei907/annotated_redis_source,JoeWoo/redis,mgk/redis,pcarrier/redis,valdsJohn/redis,YongMan/redis,july2993/redis,Cisphyx/redis-websockets,yossigo/redis,mverrilli/redis,july2993/redis,PKRoma/redis,itugs/redis,YuraLukashik/redis,jackyan/redis,NBSW/redis,danny200309/annotated_redis_source,ctripcorp/redis,JoeWoo/redis,guker/redis,kensou97/redis,MSOpenTech/redis,Aliceljm1/redis,ouyangkongtong/redis,Cisphyx/redis-websockets,tidatida/annotated_redis_source,ttuna/msot-redis,Soledad89/redis,yuzhangjob/redis-3.0-annotated-unstable,wujf/redis,zczhuohuo/redis,zhcy/redis,mengyou0304/redis,GitHubMota/redis,nuxeh/redis,riyan8250/redis,gaoxianglong/redis,itugs/redis,citusdata/redis,ytjiang/redis,tidatida/annotated_redis_source,slfs007/mk-redis,spinlock/redis,ipmobiletech/redis,blackmady/redis,Markgorden/redis,mattsta/redis,mattsta/redis,ituncle/redis,YuanZhewei/redis,HeartSaVioR/redis,slfs007/mk-redis,shreesundara/redis,jacklee0810/redis-3.0-annotated,louisliangjun/redis,OmarQunsul/graph-redis,ChaosCoo/annotated_redis_source,Wangyao14cyy/redis,wprice/redis,spearhead-ea/redis,haima-zju/redis-3.0-annotated,ton31337/redis,WorkingOfTimtohyZhang/redis-3.0-annotated,simplestbest/redis,onlymellb/redis-3.0-annotated,tanghaodong25/redis,dreamquster/redis,gaoxianglong/redis,sunlianqiang/redis-3.0-annotated,0x20h/redis,csuhawk/redis,gongice/redis-3.0-annotated,ton31337/redis,mattsta/redis,190235047/redis,MSOpenTech/redis,sunheehnus/redis,rogerchina/redis,zhaobo1023/redis-3.0-annotated,zguangyu/redis,hhli/redis,hawkchch/redis,wbailey5/redis,Soledad89/redis,drinkthere/redis-3.0-annotated,Cisphyx/redis-websockets,hgl888/redis,ituncle/redis,zguangyu/redis,atreeyang/redis,supasate/redis,ksarch-saas/redis,huyuezheng/redis,timothyohare/3rdPartySrc-redis,ReadCode/redis-3.0-annotated,maodeyi/redis_lua,shining-yang/redis,splitice/redis,allengaller/redis,Wangyao14cyy/redis,4396/redis,jacklee0810/redis-3.0-annotated,ttuna/msot-redis,Hailei/redis,danny200309/annotated_redis_source,AplayER/redis,haima-zju/redis-3.0-annotated,PKRoma/redis,valdsJohn/redis,xuguruogu/redis,tjschuck/redis,devaos/redis,oranagra/redis,Aliceljm1/redis,dayuoba/redis,PradheepShrinivasan/redis,cnbin/redis,qiyang0221/redis,zhoudayang/redis,MasahikoSawada/redis,0x55/redis-3.0-annotated,kensou97/redis,tellapart/redis,davidradunz/redis,NBSW/redis,gilala/redis,190235047/redis,holstvoogd/redis,4396/redis,mverrilli/redis,antirez/redis,xlzhan/redis,zhaobo1023/redis-3.0-annotated,jermnelson/redis,cloudrain21/redis,kensou97/redis,wangyikai/redis,gspandy/annotated_redis_source,jasonkying/redis,HunanTV/redis,ramonsnir/redis,gechong/redis-3.0-annotated,MasahikoSawada/redis,abhiklodh/redis,YongMan/redis,tellapart/redis,holstvoogd/redis,aim-for-better/redis,gilala/redis,mumingv/redis-3.0-annotated,mengzhejin/RedisStudy,0x20h/redis,huangz1990/redis-3.0-annotated,YuanZhewei/redis,gspandy/annotated_redis_source,huangz1990/experiment-redis,davidradunz/redis,neomantra/redis,danny200309/annotated_redis_source,nnog/redis,OmarQunsul/graph-redis,mengzhejin/RedisStudy,JoeWoo/redis,july2993/redis,mumingv/redis,kaushik94/redis,HeartSaVioR/redis,neomantra/redis,wangyikai/redis,yossigo/redis,CodeJuan/redis,GitHubMota/redis,seandsky/redis,huangz1990/annotated_redis_source,himoca/redis,zhcy/redis,PradheepShrinivasan/redis,jbochi/redis,yuhc/redis-benchmark-enhanced,huangz1990/experiment-redis,ctripcorp/redis,h0x91b/redis,nnog/redis,SummonY/redis,healerkx/redis,ketor/redis,csuhawk/redis,atreeyang/redis,oranagra/redis,idning/redis,tellapart/redis,huyuezheng/redis,HeartSaVioR/redis,francischan714/redis,ofirluzon/redis,Markgorden/redis,zhiliaoniu/redis,CodeJuan/redis,arijitvt/redis,StevenTsai/redis,viongpanzi/annotated_redis_source,brg-liuwei/redis,ofirluzon/redis,miaoyc1989/redis-3.0-annotated,YongMan/redis,NBSW/redis,LongXQ/redis,gilala/hredis,YongMan/redis,gechong/redis-3.0-annotated,atreeyang/redis,a-pavlov/redis,RepmujNetsik/redis,clamoriniere1A/redis,ReadCode/redis-3.0-annotated,MOON-CLJ/redis,ReadCode/redis-3.0-annotated,machicao2013/redis-source-annotated,guker/redis,WorkingOfTimtohyZhang/redis-3.0-annotated,arijitvt/redis,oranagra/redis,yuzhangjob/redis-3.0-annotated-unstable,SummonY/redis,fengshao0907/annotated_redis_source,seppo0010/redis,GrimDerp/redis,4396/redis,jackyan/redis,shining-yang/redis,mingyaaaa/redis,Markgorden/redis,msn217/redis-3.0-annotated,idning/redis,miaoyc1989/redis-3.0-annotated,mengzhejin/RedisStudy,pietern/redis,xujunhai1991/redis,HunanTV/redis,hawkchch/redis,gilala/bjredis,iandyh/redis,gspandy/annotated_redis_source,roth1002/redis,ofirluzon/redis,kmiku7/redis,rouzier/redis,nnog/redis,gilala/hredis,taoguan/redis,dayuoba/redis,mpalmer/redis,darksideofthemoo/redis-histogram,onlymellb/redis-3.0-annotated,colstrom/redis,haima-zju/redis-3.0-annotated,dayuoba/redis,yuhc/redis-benchmark-enhanced,gilala/bjredis,whille/redis-3.0-annotated,charsyam/redis,fengshao0907/redis,ChanningDuan/annotated_redis_source,vincent-vivian-liu/redis,valdsJohn/redis,huangz1990/experiment-redis,wuxiaowei907/annotated_redis_source,gongice/redis-3.0-annotated,AALEKH/redis,LongXQ/redis,whille/redis-3.0-annotated,cloudrain21/redis,pedigree/redis,rogerchina/redis,hgl888/redis,nilyang/redis-tdd-annotation,jxwr/redis,AALEKH/redis,hawkchch/redis,tellapart/redis,figoxu/annotated_redis_source,wuyu201321060203/redis-3.0-annotated,shshlzh/redis-3.0-annotated,iandyh/redis,colstrom/redis,ipmobiletech/redis,huyuezheng/redis,MSOpenTech/redis,jingjidejuren/redis,h0x91b/redis,shshlzh/redis-3.0-annotated,seandsky/redis,mumingv/redis-3.0-annotated,cusspvz/redis,cusspvz/redis,slfs007/mk-redis,csuhawk/redis,GrimDerp/redis,aim-for-better/redis,AALEKH/redis,janekmi/redis,arijitvt/redis,modulexcite/redis,zy416548283/redis-3.0-annotated,brg-liuwei/redis,h0x91b/redis,SummonY/redis,jacklee0810/annotated_redis_source,PKRoma/redis,MOON-CLJ/redis,soveran/redis,healerkx/redis,unasm/redis-3.0-annotated,h0x91b/redis,unasm/redis-3.0-annotated,pkdevbox/redis,onlymellb/redis-3.0-annotated,ipmobiletech/redis,hhli/redis,fengshao0907/annotated_redis_source,alenslan/redis,rouzier/redis,ncopa/redis,ofirluzon/redis,gilala/hredis,clamoriniere1A/redis,zy416548283/redis-3.0-annotated,0x55/redis-3.0-annotated,zhoudayang/redis,xujunhai1991/redis,jermnelson/redis,Soledad89/redis,jbochi/parallel_redis,jbochi/redis,idning/redis,drinkthere/redis-3.0-annotated,gilala/bjredis,duanx/redis,jacklee0810/annotated_redis_source,mingyaaaa/redis,shshlzh/redis-3.0-annotated,pedigree/redis,SyntaxStacks/redis,Sciumo/redis,yybirdcf/learn-redis,zhoudayang/redis,wbailey5/redis,shining-yang/redis,abhiklodh/redis,honestme/redis,j0hnma/hszredis,StevenTsai/redis,janekmi/redis,nuxeh/redis,antirez/redis,seppo0010/redis,duanx/redis,whille/redis-3.0-annotated,saisai/redis,harrisonfeng/redis,fengshao0907/redis,modulexcite/redis,RepmujNetsik/redis,YuraLukashik/redis,tjschuck/redis,huangz1990/redis-3.0-annotated,YuraLukashik/redis,jxwr/redis,twskipper/redis,AplayER/redis,neomantra/redis,Aaron1992/redis,wuyu201321060203/redis-3.0-annotated,machicao2013/redis-source-annotated,blackmady/redis,hornen/redis,rogerlz/redis,antirez/redis,xuguruogu/redis,Hailei/redis,Aliceljm1/redis-3.0-annotated,yuhc/redis-benchmark-enhanced,Aliceljm1/redis-3.0-annotated,devaos/redis,SyntaxStacks/redis,riyan8250/redis,pmem/redis,ncopa/redis,qiyang0221/redis,mumingv/redis-3.0-annotated,j0hnma/szredis,adamweixuan/redis-3.0-annotated,tjschuck/redis,wujf/redis,wujf/redis,StevenTsai/redis,ksarch-saas/redis,0x55/redis-3.0-annotated,july2993/redis,saisai/redis,gilala/redis,rrsean/redis-3.0-annotated,spearhead-ea/redis,wprice/redis,nilyang/redis-tdd-annotation,takeshineshiro/redis,thomasdarimont/redis,figoxu/annotated_redis_source,mpalmer/redis,dayuoba/redis,fengshao0907/redis,itugs/redis,ChaosCoo/annotated_redis_source,healerkx/redis,harrisonfeng/redis,huyuezheng/redis,zhiliaoniu/redis,wangyikai/redis,yossigo/redis,HouKangkang/redis-3.0-annotated,splitice/redis,jingjidejuren/redis,duanx/redis,Sciumo/redis,shreesundara/redis,nilyang/redis-tdd-annotation,jingjidejuren/redis,izhoujie/redis,xuzhezhaozhao/redis_reading,wenxueliu/redis_comment,PKRoma/redis,riyan8250/redis,gechong/redis-3.0-annotated,sunheehnus/redis,universsky/redis,seppo0010/rlite-server,huangz1990/experiment-redis,Cisphyx/redis-websockets,oranagra/redis,splitice/redis,hornen/redis,linfangrong/redis,ttuna/msot-redis,huangz1990/redis-3.0-annotated,YuraLukashik/redis,duanx/redis,yossigo/redis,GitHubMota/redis,Wangyao14cyy/redis,arijitvt/redis,xlzhan/redis,ChaosCoo/annotated_redis_source,fankeke/redis-3.0-annotated,allengaller/redis,fengshao0907/redis-3.0-annotated,StevenTsai/redis,francischan714/redis,janekmi/redis,citusdata/redis,itugs/redis,gaoxianglong/redis,universsky/redis,jasonkying/redis,linfangrong/redis,modulexcite/redis,tanghaodong25/redis,davidradunz/redis,cusspvz/redis,z-fork/redis,elkingtonmcb/redis,HunanTV/redis,badboy/redis,ErikDubbelboer/redis,MSOpenTech/redis,neomantra/redis,simplestbest/redis,abhiklodh/redis,wbailey5/redis,hornen/redis,shining-yang/redis,mcanthony/redis,csuhawk/redis,jacklee0810/redis-3.0-annotated,darksideofthemoo/redis-histogram,YuanZhewei/redis,soveran/redis,harrisonfeng/redis,yybirdcf/learn-redis,CodeJuan/redis,gilala/hbjredis,abhiklodh/redis,z-fork/redis,valdsJohn/redis,honestme/redis,j0hnma/hszredis,francischan714/redis,dramenk/annotated_redis_source,rrsean/redis-3.0-annotated,a-pavlov/redis,RepmujNetsik/redis,buobao/redis-3.0-annotated,holstvoogd/redis,SyntaxStacks/redis,OmarQunsul/graph-redis,ouyangkongtong/redis,mcanthony/redis,splitice/redis,saisai/redis,huangz1990/annotated_redis_source,idning/redis,JoeWoo/redis,hedisdb/hedis,kmiku7/redis,saisai/redis,CodeJuan/redis,Aaron1992/redis,ErikDubbelboer/redis,PradheepShrinivasan/redis,wenxueliu/redis_comment,sunheehnus/redis,jbochi/parallel_redis,ErikDubbelboer/redis,mengyou0304/redis,mumingv/redis,ouyangkongtong/redis,j0hnma/hszredis,spearhead-ea/redis,hhli/redis,rouzier/redis,hgl888/redis,nuxeh/redis,netroby/redis,kaushik94/redis,jxwr/redis,adamweixuan/redis-3.0-annotated,seppo0010/redis,kaushik94/redis,zhiliaoniu/redis,rogerlz/redis,gilala/redis,charsyam/redis,gilala/hbjredis,ctripcorp/redis,a-pavlov/redis,xuguruogu/redis,ytjiang/redis,jacklee0810/annotated_redis_source,iandyh/redis,guker/redis,zhaobo1023/redis-3.0-annotated,elkingtonmcb/redis,jackyan/redis,rouzier/redis,ouyangkongtong/redis,Hailei/redis,jbochi/parallel_redis,blackmady/redis,pkdevbox/redis,dongqifan2/redis-3.0-annotated,zhcy/redis,izhoujie/redis,wangyikai/redis,seppo0010/rlite-server,twskipper/redis,drinkthere/redis-3.0-annotated,universsky/redis,narma/redis,LongXQ/redis,izhoujie/redis,HouKangkang/redis-3.0-annotated,moonbingbing/redis-3.0-annotated,hgl888/redis,AplayER/redis,rogerlz/redis,wprice/redis,Aliceljm1/redis,maodeyi/redis_lua,0x20h/redis,pietern/redis,machicao2013/redis-source-annotated,GrimDerp/redis,izhoujie/redis,ChanningDuan/annotated_redis_source,yuhc/redis-benchmark-enhanced,programmecat/redis,takeshineshiro/redis,a-pavlov/redis,janekmi/redis,guker/redis,universsky/redis,ofirluzon/redis,colstrom/redis,iandyh/redis,MSOpenTech/redis,ketor/redis,hawkchch/redis,ncopa/redis,xuzhezhaozhao/redis_reading,magastzheng/redis-3.0-annotated,xujunhai1991/redis,yuzhangjob/redis-3.0-annotated-unstable,mpalmer/redis,weizijun/redis,shreesundara/redis,dramenk/annotated_redis_source,cnbin/redis,viongpanzi/annotated_redis_source,charsyam/redis,darksideofthemoo/redis-histogram,davidradunz/redis,twskipper/redis,xlzhan/redis,PKRoma/redis,kensou97/redis,dreamquster/redis,ytjiang/redis,aim-for-better/redis,timothyohare/3rdPartySrc-redis,riyan8250/redis,HeartSaVioR/redis,pedigree/redis,xlzhan/redis,pmem/redis,wuyu201321060203/redis-3.0-annotated,badboy/redis,taoguan/redis,GrimDerp/redis,pmem/redis,himoca/redis,z-fork/redis,dongqifan2/redis-3.0-annotated,holstvoogd/redis,ttuna/msot-redis,zhcy/redis,fankeke/redis-3.0-annotated,buobao/redis-3.0-annotated,jingjidejuren/redis,linfangrong/redis,ncopa/redis,ton31337/redis,xuzhezhaozhao/redis_reading,Aliceljm1/redis-3.0-annotated,shshlzh/redis-3.0-annotated,thomasdarimont/redis,mcanthony/redis,tzq668766/redis-3.0-annotated,0x55/redis-3.0-annotated,Aaron1992/redis,louisliangjun/redis,YuanZhewei/redis,mverrilli/redis,zczhuohuo/redis,MOON-CLJ/redis,msn217/redis-3.0-annotated,tzq668766/redis-3.0-annotated,zguangyu/redis,hedisdb/hedis,pkdevbox/redis,fengshao0907/annotated_redis_source,pietern/redis,soveran/redis,pkdevbox/redis,spinlock/redis,xuzhezhaozhao/redis_reading,miaoyc1989/redis-3.0-annotated,supasate/redis,cnbin/redis,j0hnma/hszredis,itamarhaber/redis,badboy/redis,flashbuckets/redis,twskipper/redis,josiahcarlson/redis,PradheepShrinivasan/redis,seppo0010/redis,gaoxianglong/redis,clamoriniere1A/redis,magastzheng/redis-3.0-annotated,itamarhaber/redis,mingyaaaa/redis,soloestoy/redis,wenxueliu/redis_comment,devaos/redis,Aaron1992/redis,simplestbest/redis,louisliangjun/redis,modulexcite/redis,seandsky/redis,tidatida/annotated_redis_source,gilala/hbjredis,viongpanzi/annotated_redis_source,alenslan/redis,SummonY/redis,buobao/redis-3.0-annotated,takeshineshiro/redis,allengaller/redis,huangz1990/annotated_redis_source,programmecat/redis,timothyohare/3rdPartySrc-redis,elkingtonmcb/redis,harrisonfeng/redis,xuguruogu/redis,pietern/redis,neomantra/redis,hornen/redis,fengshao0907/redis,netroby/redis,mengyou0304/redis,spinlock/redis,gilala/bjredis,ituncle/redis,ttuna/msot-redis,dramenk/annotated_redis_source,pmem/redis,darksideofthemoo/redis-histogram,ChanningDuan/annotated_redis_source,weizijun/redis,dreamquster/redis,j0hnma/szredis,soloestoy/redis,machicao2013/redis-source-annotated,mgk/redis,brg-liuwei/redis,mverrilli/redis,himoca/redis,ituncle/redis,mengzhejin/RedisStudy,flashbuckets/redis,xujunhai1991/redis,HouKangkang/redis-3.0-annotated,wbailey5/redis,AALEKH/redis,roth1002/redis,HunanTV/redis,Hailei/redis,yossigo/redis,zhiliaoniu/redis,OmarQunsul/graph-redis,josiahcarlson/redis,citusdata/redis,pcarrier/redis,honestme/redis,mumingv/redis,ksarch-saas/redis,maodeyi/redis_lua,fankeke/redis-3.0-annotated,allengaller/redis,vincent-vivian-liu/redis,tanghaodong25/redis,z-fork/redis,wuyu201321060203/redis-3.0-annotated,pedigree/redis,kmiku7/redis,ramonsnir/redis,moonbingbing/redis-3.0-annotated,SyntaxStacks/redis,itamarhaber/redis,roth1002/redis,hedisdb/hedis,pcarrier/redis,mgk/redis,seppo0010/rlite-server,takeshineshiro/redis,mengyou0304/redis,netroby/redis,sunheehnus/redis,qiyang0221/redis,soveran/redis,weizijun/redis,ctripcorp/redis,ramonsnir/redis,MasahikoSawada/redis,unasm/redis-3.0-annotated,soloestoy/redis,cnbin/redis,soloestoy/redis,WorkingOfTimtohyZhang/redis-3.0-annotated,rogerlz/redis,wprice/redis,josiahcarlson/redis,ipmobiletech/redis,ton31337/redis,wenxueliu/redis_comment,zczhuohuo/redis,sunlianqiang/redis-3.0-annotated,narma/redis,dongqifan2/redis-3.0-annotated,mingyaaaa/redis,francischan714/redis,tanghaodong25/redis,j0hnma/szredis,fengshao0907/redis-3.0-annotated,gongice/redis-3.0-annotated,Sciumo/redis,mumingv/redis,190235047/redis,wujf/redis,thomasdarimont/redis,badboy/redis,josiahcarlson/redis,kmiku7/redis,qiyang0221/redis,4396/redis,mpalmer/redis,nnog/redis,roth1002/redis,mgk/redis,programmecat/redis,devaos/redis,LongXQ/redis,kaushik94/redis,adamweixuan/redis-3.0-annotated,taoguan/redis,ytjiang/redis,healerkx/redis,jermnelson/redis,supasate/redis,shreesundara/redis,MasahikoSawada/redis,citusdata/redis,linfangrong/redis,oranagra/redis,itamarhaber/redis,clamoriniere1A/redis,jasonkying/redis,ksarch-saas/redis,alenslan/redis,tjschuck/redis,NBSW/redis,taoguan/redis,honestme/redis,flashbuckets/redis,Aliceljm1/redis,colstrom/redis,programmecat/redis,wuxiaowei907/annotated_redis_source,elkingtonmcb/redis,netroby/redis,antirez/redis,cusspvz/redis,cloudrain21/redis,miaoyc1989/redis-3.0-annotated,ErikDubbelboer/redis,charsyam/redis,ketor/redis,alenslan/redis,cloudrain21/redis,fengshao0907/redis-3.0-annotated,GitHubMota/redis,tzq668766/redis-3.0-annotated,zguangyu/redis,gilala/hredis,figoxu/annotated_redis_source,brg-liuwei/redis,yybirdcf/learn-redis,moonbingbing/redis-3.0-annotated,simplestbest/redis,Wangyao14cyy/redis,vincent-vivian-liu/redis,nilyang/redis-tdd-annotation,sunlianqiang/redis-3.0-annotated,jackyan/redis,timothyohare/3rdPartySrc-redis,Sciumo/redis,dreamquster/redis,seppo0010/rlite-server,0x20h/redis,soloestoy/redis,aim-for-better/redis,weizijun/redis,nuxeh/redis,msn217/redis-3.0-annotated,vincent-vivian-liu/redis,atreeyang/redis,rrsean/redis-3.0-annotated,gilala/hbjredis,louisliangjun/redis,hhli/redis,blackmady/redis,zy416548283/redis-3.0-annotated,charsyam/redis,pcarrier/redis,yybirdcf/learn-redis,jbochi/redis,narma/redis,hedisdb/hedis,rogerchina/redis,zczhuohuo/redis,rogerchina/redis,AplayER/redis,jasonkying/redis,spinlock/redis,flashbuckets/redis,magastzheng/redis-3.0-annotated,zhoudayang/redis,thomasdarimont/redis,j0hnma/szredis