Debugging failing unit tests is hard if the failure is non-deterministic and the seed is not known.
Fix that by printing the seed and making it possible to set the seed from outside.
Backport of Core [[https://github.com/bitcoin/bitcoin/pull/16978 | PR16978]]