SDS: improve sdsRemoveFreeSpace() to avoid useless data copy.
SDS: improve sdsRemoveFreeSpace() to avoid useless data copy.

Since SDS v2, we no longer have a single header, so the function to
rewrite the SDS in terms of the minimum space required, instead of just
using realloc() and let the underlying allocator decide what to do,
was doing an allocation + copy every time the minimum possible header
needed to represent the string was different than the current one.
This could be often a bit wasteful, because if we go, for instance, from
the 32 bit fields header to the 16 bit fields header, the overhead of
the header is normally very small. With this commit we call realloc
instead, unless the change in header size is very significant in relation
to the string length.

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