fix potential race condition in detached threads
[musl] / crt / crti.c