Replication: better way to send a preamble before RDB payload.

During the replication full resynchronization process, the RDB file is
transfered from the master to the slave. However there is a short
preamble to send, that is currently just the bulk payload length of the
file in the usual Redis form $..length..<CR><LF>.

This preamble used to be sent with a direct write call, assuming that
there was alway room in the socket output buffer to hold the few bytes
needed, however this does not scale in case we'll need to send more
stuff, and is not very robust code in general.

This commit introduces a more general mechanism to send a preamble up to
2GB in size (the max length of an sds string) in a non blocking way.
	modified:   zmalloc.c
	modified:   zmalloc.h
	modified:   zipmap.c
	modified:   zipmap.c
	modified:   util.c
	modified:   ziplist.c
Merge branch 'unstable' of github.com:xgwang/redis-comment into unstable
	modified:   ziplist.c