Catch HTTP header parser errors early, to provide a good response to client.
Reimplemented getsockopt SO_ERROR mechanism with FFI