Various downstream writing fixes.

* bugfix: ngx.flush(), ngx.eof(), and some other things did not update
  busy/free chains after calling the output filters.
* bugfix: ngx_gzip/ngx_gunzip filters might cause ngx.flush(true) to
  hang until timeout for nginx 1.7.7+ (and some other very old versions
  of nginx). thanks Maxim Dounin for the help.