fix race condition found by thread sanitizer
fix race condition found by thread sanitizer

devnexen/deviceatlas-cloud-c,devnexen/deviceatlas-cloud-c,devnexen/deviceatlas-cloud-c,devnexen/deviceatlas-cloud-c