endpoint: Fix use after free

It's considered legal for an on_close callback to call endpoint_deinit (for
example in test_client.c). Fix protocol to NULL out the darrays it
destroys in protocol_deinit_conn, and then check for this condition
before trimming buffers in deactivate_conn in endpoint.c.
serv/client: auto-respond with pong if no callback

Meant to do this in a previous commit. If you don't specify an on_ping
callback, the implementation should respond with a pong for you.