Core: guard against failed allocation during binary upgrade.

Patch by Piotr Sikora.
The limit_req_status and limit_conn_status directives.

Patch by Nick Marden, with minor changes.