> While reproducing the bug from #18517, I've noticed that the bitcoind.pid file has already been removed when the bitcoind hangs.
> This PR makes Shutdown() keep the bitcoind.pid file available until the end.
This is a backport of Core [[https://github.com/bitcoin/bitcoin/pull/18526 | PR18526]]