Import proposed upstream fix [2] for the critical locking
synchronization bug recently found in musl [1].
This affects all programs that are temporarily multithreaded, but then
return to single-threaded operation.
[1] https://www.openwall.com/lists/musl/2020/05/22/3
[2] https://www.openwall.com/lists/musl/2020/05/22/10
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
(cherry picked from commit 10c211031ccd4703230493025a5a3b9d6fcad2f2)