MINOR: applet: Add a destroy callback to the applets
The applet ops provide callbacks for the applet lifecycle: an init callback
called before the applet starts processing, a shut callback called when one
side of the applet endpoint is shut, and a release callback called when both
sides are shut. But there is no callback called when the applet context is
destroyed, when its last user is released: the release callback may run long
before, while the stream attached to the applet is still alive, so the
applets holding references on objects used by their stream have no way to
know when to drop them.
Add a destroy callback to the applet ops, called by __appctx_free() when the
applet context is destroyed. It happens during the teardown of the stream
attached to the applet (from sc_destroy(), inside stream_free()). So this is
guaranteed to be after the last run of the stream, even if it was requeued
instead of being immediately freed.