close
Closes the endpoint: the terminal transition, with CoapException.Reason.CLOSED. Open exchanges fail with it, observations end, connections are released (RFC 8323 §5.5), the endpoint's coroutines are cancelled and the transports closed. Returns once that is done; it does not wait for the cancelled coroutines, so a request handler may call it. Idempotent: after any terminal transition it only waits for that one to finish.