libc/libpthread: Inject threadsafe locking callbacks for rtld.
* Make rtld thread-safe. Add lib/libthread_xu/thread/thr_rtld.c
to the build and use it to inject pthread based locking callbacks
for rtld.
* In rtld_lock.c, do the thread_mask_clear(lock->mask); after releasing
the actual lock, to avoid deadlocks when rtld is called recursively
from the pthread locking callbacks.
XXX An alternative solution for this issue would be, to flag the
libpthread dynamic library as bind_now to avoid the recursive rtld
calls.