Rewrite parsing logic in m_httpd.

Also, various minor improvements:

- Fix SendHeaders when the value of http_version is unusual.
- Strip trailing path seperators before calling module events.
- Only write debug logs in handlers in events they care about.
- Close HTTP sockets when an error happens.
- Use InspIRCd::TimeString instead of the C time functions.