lock: Fix link error with --enable-threads=pth.