Fixed segmentation fault if http context is not defined.
Merge branch 'nginx_refactoring' of github.com:defanator/ModSecurity into nginx_refactoring
Removed unneeded and invalid initialization.
Obtain port from r->connection->local_sockaddr.

This eliminates segfaults caused by unset (NULL) r->port_start
and non-NULL r->port_end. In fact, r->port_start is always NULL,
so it is useless to rely on this pointer.
Fixed ngx_http_modsecurity_header_filter() to call next header filter eventually.

Returning of NGX_OK there may lead to request's hang, in particular when HEAD
method is used.
Fixed ngx_http_modsecurity_body_filter() to properly handle filters chain.

Body filter is a wrong place to call ngx_http_next_header_filter() - that
function is intended to be called from header filters.
In case when there were no errors, body filter should call
ngx_http_next_body_filter() eventually.
While here, also removed useless second return.
All ngx_log_debug() calls changed to ngx_log_debug0().
Explicitly set log object to r->connection->log in preaccess phase handler.

This change fixes a number of scenarios when ModSecurity's log entries
may be written to the wrong file descriptors. In particular, there was
an issue with almost any configuration using nginx cache features
(proxy_cache, fastcgi_cache, etc) when garbage from ModSecurity logs
has been sent to the control socket used for communication between
nginx master process and auxiliary processes (workers, cache manager,
cache loader).

Described behavior was observed with nginx/1.7.0, modsecurity/2.8.0
and OWASP CRS v2.2.9.
Merge branch 'nginx_refactoring' of https://github.com/defanator/ModSecurity into nginx_refactoring_def