libc/libpthread: Inject threadsafe locking callbacks for rtld.