SW-171. Fix.

race condition in open/close CoAP