generate_wif_key is a wallet utility function. Move
it from the EC key module to the wallet util module.
This is a backport of [[https://github.com/bitcoin/bitcoin/pull/19239 | core#19239]]
Backport note: the revert commit is not relevant, we haven't backported [[https://github.com/bitcoin/bitcoin/pull/19230 | core#19230]]