util: Don't reference errno when pthread fails.
util: Don't reference errno when pthread fails.

Pthread library does not set errno.
Pthread library's errno is returned by return value.

Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>

Github-Pull: #19194
Rebased-From: cb38b069b0f41b1a26264784b1c1303c8ac6ab08

DigitalPandacoin/pandacoin,monacoinproject/monacoin,GroestlCoin/GroestlCoin,GroestlCoin/bitcoin,monacoinproject/monacoin,qtumproject/qtum,qtumproject/qtum,qtumproject/qtum,peercoin/peercoin,vertcoin/vertcoin,DigitalPandacoin/pandacoin,qtumproject/qtum,DigitalPandacoin/pandacoin,vertcoin/vertcoin,qtumproject/qtum,GroestlCoin/GroestlCoin,ahmedbodi/vertcoin,ahmedbodi/vertcoin,GroestlCoin/GroestlCoin,GroestlCoin/bitcoin,DigitalPandacoin/pandacoin,monacoinproject/monacoin,GroestlCoin/GroestlCoin,DigitalPandacoin/pandacoin,GroestlCoin/bitcoin,GroestlCoin/GroestlCoin,peercoin/peercoin,peercoin/peercoin,ahmedbodi/vertcoin,vertcoin/vertcoin,ahmedbodi/vertcoin,peercoin/peercoin,monacoinproject/monacoin,GroestlCoin/bitcoin,qtumproject/qtum,monacoinproject/monacoin,qtumproject/qtum,peercoin/peercoin,GroestlCoin/bitcoin,vertcoin/vertcoin,GroestlCoin/bitcoin,vertcoin/vertcoin,DigitalPandacoin/pandacoin,vertcoin/vertcoin,peercoin/peercoin,ahmedbodi/vertcoin,monacoinproject/monacoin,ahmedbodi/vertcoin,GroestlCoin/GroestlCoin