s3: Implement global locks in a g_lock tdb