unix,win: fix threadpool race condition
unix,win: fix threadpool race condition

90891b4232e91dbd7a2e2077e4d23d16a374b41d introduced a race
condition when accessing `slow_io_work_running` – it is being
increased and later decreased as part of the worker thread loop,
but was accessed with different mutexes during these operations.

This fixes the race condition by making sure both accesses
are protected through the global `mutex` of `threadpool.c`.

This fixes a number of flaky Node.js tests.

Refs: https://github.com/libuv/libuv/pull/1845
Refs: https://github.com/nodejs/reliability/issues/18
Refs: https://github.com/nodejs/node/issues/23089
Refs: https://github.com/nodejs/node/issues/23067
Refs: https://github.com/nodejs/node/issues/23066
Refs: https://github.com/nodejs/node/issues/23219
PR-URL: https://github.com/libuv/libuv/pull/2021
Reviewed-By: Santiago Gimeno <3f17e29e343c4cf8809fb0970d81d6d8ee88d6b3@gmail.com>
Reviewed-By: Colin Ihrig <838f779c91673db29b8572ea3f54d191d3878ae2@gmail.com>
Reviewed-By: Ben Noordhuis <59bd0a3ff43b32849b319e645d4798d8a5d1e889@bnoordhuis.nl>

unknownbrackets/maxcso,unknownbrackets/maxcso,unknownbrackets/maxcso,unknownbrackets/maxcso,unknownbrackets/maxcso,unknownbrackets/maxcso,unknownbrackets/maxcso