Change 33492 did not spread the protection wide enough. There were
still two more races to be lost.
1: The close() could still happen after the (premature) mutex release
allowed another thread to dup() to that file descriptor.
2: The initial dup() could happen whilst another thread was in the
mutex protected region, and had temporarily closed the file
descriptor.
Race conditions remain with any other thread that actually does I/O
during the execution of the mutex protected region (as noted in a
comment), and dup() failure is not handled gracefully (also noted).
p4raw-id: //depot/perl@33498