Merge of r4966: gzip: fixed zlib memLevel adjusting.

An incorrect memLevel (lower than 1) might be passed to deflateInit2() if the
"gzip_hash" directive is set to a value less than the value of "gzip_window"
directive. This resulted in "deflateInit2() failed: -2" alert and an empty
reply.


git-svn-id: svn://svn.nginx.org/nginx/branches/stable-1.2@5046 73f98a42-aea0-e011-b76d-00259023448c
Merge of r4967: ngx_write_fd() and ngx_read_fd() errors handling.

The ngx_write_fd() and ngx_read_fd() functions return -1 in case of error,
so the incorrect comparison with NGX_FILE_ERROR (which is 0 on windows
platforms) might result in inaccurate error message in the error log.

Also the ngx_errno global variable is being set only if the returned value
is -1.


git-svn-id: svn://svn.nginx.org/nginx/branches/stable-1.2@5047 73f98a42-aea0-e011-b76d-00259023448c