So... why don't you use O_CLOEXEC on platforms that support it instead of this mutex hackery?