Fix refcnting bug in DTLS