Modules: implement zig-zag scanning in autoMemoryFreed().
Modules: implement zig-zag scanning in autoMemoryFreed().

Most of the time to check the last element is the way to go, however
there are patterns where the contrary is the best choice. Zig-zag
scanning implemented in this commmit always checks the obvious element
first (the last added -- think at a loop where the last element
allocated gets freed again and again), and continues checking one
element in the head and one in the tail.

Thanks to @dvisrky that fixed the original implementation of the
function and proposed zig zag scanning.

ctripcorp/redis,hgl888/redis,badboy/redis,ton31337/redis,zguangyu/redis,charsyam/redis,oranagra/redis,ofirluzon/redis,YongMan/redis,badboy/redis,YongMan/redis,neomantra/redis,neomantra/redis,GitHubMota/redis,ton31337/redis,hgl888/redis,rogerchina/redis,colstrom/redis,Markgorden/redis,neomantra/redis,yossigo/redis,ofirluzon/redis,neomantra/redis,nnog/redis,sunheehnus/redis,antirez/redis,zguangyu/redis,antirez/redis,GitHubMota/redis,OmarQunsul/graph-redis,Sciumo/redis,yossigo/redis,OmarQunsul/graph-redis,ctripcorp/redis,colstrom/redis,oranagra/redis,ton31337/redis,soloestoy/redis,yossigo/redis,badboy/redis,h0x91b/redis,PKRoma/redis,kensou97/redis,oranagra/redis,pmem/redis,Sciumo/redis,badboy/redis,zguangyu/redis,spinlock/redis,yossigo/redis,Sciumo/redis,ctripcorp/redis,pmem/redis,colstrom/redis,charsyam/redis,soloestoy/redis,colstrom/redis,dreamquster/redis,pmem/redis,arijitvt/redis,YongMan/redis,pmem/redis,sunheehnus/redis,OmarQunsul/graph-redis,oranagra/redis,spinlock/redis,rogerchina/redis,sunheehnus/redis,soloestoy/redis,zguangyu/redis,soloestoy/redis,spinlock/redis,oranagra/redis,ofirluzon/redis,spinlock/redis,ofirluzon/redis,arijitvt/redis,kensou97/redis,arijitvt/redis,Markgorden/redis,charsyam/redis,PKRoma/redis,hgl888/redis,hgl888/redis,PKRoma/redis,nnog/redis,neomantra/redis,PKRoma/redis,ctripcorp/redis,Markgorden/redis,antirez/redis,nnog/redis,kensou97/redis,nnog/redis,antirez/redis,PKRoma/redis,soveran/redis,kensou97/redis,rogerchina/redis,sunheehnus/redis,Sciumo/redis,arijitvt/redis,h0x91b/redis,ton31337/redis,OmarQunsul/graph-redis,ofirluzon/redis,h0x91b/redis,yossigo/redis,rogerchina/redis,soveran/redis,dreamquster/redis,soveran/redis,GitHubMota/redis,charsyam/redis,soloestoy/redis,dreamquster/redis,charsyam/redis,Markgorden/redis,soveran/redis,YongMan/redis,GitHubMota/redis,dreamquster/redis,h0x91b/redis