Add Windows shutdown handler
Exit properly when clicked the red X of Windows Console.
Backport of core PR13131:
Cross build for windows.
Run bitcoind.exe in a console and exit with the "red X" (or hit
CTRL+C) button of the console. The software should terminate
gracefully (previously it would abort on an assertion failed in
Reviewers: #bitcoin_abc, deadalnix, jasonbcox
Reviewed By: #bitcoin_abc, jasonbcox
Differential Revision: https://reviews.bitcoinabc.org/D4460