[bitcoin/bitcoin] Correctly terminate HTTP server (#13501)

Seems that `bitcoind` would hang during shutdown progress on Windows sometimes.

#14007 :
https://ci.appveyor.com/project/DrahtBot/bitcoin/build/master.243

#14007 + #13501 :
https://ci.appveyor.com/project/ken2812221/bitcoin/build/test-promag-http-shutdown.275