Fix MIGRATE closing of cached socket on error.
Fix MIGRATE closing of cached socket on error.

After investigating issue #3796, it was discovered that MIGRATE
could call migrateCloseSocket() after the original MIGRATE c->argv
was already rewritten as a DEL operation. As a result the host/port
passed to migrateCloseSocket() could be anything, often a NULL pointer
that gets deferenced crashing the server.

Now the socket is closed at an earlier time when there is a socket
error in a later stage where no retry will be performed, before we
rewrite the argument vector. Moreover a check was added so that later,
in the socket_err label, there is no further attempt at closing the
socket if the argument was rewritten.

This fix should resolve the bug reported in #3796.

ctripcorp/redis,neomantra/redis,oranagra/redis,GitHubMota/redis,soveran/redis,soveran/redis,spinlock/redis,oranagra/redis,dreamquster/redis,antirez/redis,ctripcorp/redis,YongMan/redis,ofirluzon/redis,neomantra/redis,Sciumo/redis,nnog/redis,hgl888/redis,GitHubMota/redis,kensou97/redis,YongMan/redis,ctripcorp/redis,neomantra/redis,oranagra/redis,GitHubMota/redis,soloestoy/redis,soloestoy/redis,rogerchina/redis,PKRoma/redis,pmem/redis,Sciumo/redis,spinlock/redis,PKRoma/redis,ofirluzon/redis,soloestoy/redis,antirez/redis,ofirluzon/redis,rogerchina/redis,rogerchina/redis,oranagra/redis,charsyam/redis,kensou97/redis,yossigo/redis,dreamquster/redis,charsyam/redis,oranagra/redis,hgl888/redis,GitHubMota/redis,charsyam/redis,yossigo/redis,nnog/redis,soveran/redis,soloestoy/redis,rogerchina/redis,antirez/redis,Sciumo/redis,YongMan/redis,neomantra/redis,ofirluzon/redis,neomantra/redis,soveran/redis,PKRoma/redis,soloestoy/redis,pmem/redis,YongMan/redis,hgl888/redis,charsyam/redis,kensou97/redis,charsyam/redis,dreamquster/redis,spinlock/redis,yossigo/redis,hgl888/redis,pmem/redis,PKRoma/redis,Sciumo/redis,dreamquster/redis,yossigo/redis,pmem/redis,yossigo/redis,kensou97/redis,nnog/redis,spinlock/redis,ctripcorp/redis,nnog/redis,antirez/redis,PKRoma/redis,ofirluzon/redis