Don't acquire contended lock with the OS thread locked.
Don't acquire contended lock with the OS thread locked.

Fixes #1049

PiperOrigin-RevId: 297175164

google/gvisor,google/gvisor,google/gvisor,google/gvisor,google/gvisor,google/gvisor,google/gvisor,google/gvisor