MFC r265845:
Style.
MFC r246872 (by davidxu):

Simplify code by using flag O_EXLOCK.
MFC r246894 (by davidxu):
Make more code be protected by internal mutex.
MFC r265847:
Fix sem_unlink(3) to properly invalidate the semaphores name cache.

PR:	standards/189353