Reset packet state before handing control to user

The connection will be in an invalid state if the event handler
throws an exception.