Only log parsing details when _CX_DEBUG macro is enabled.
Let protocol handler close connection.
Added macros to set READ/WRITE errors before executing the callback.