After having run bitcoin-qt 0.14.0 for a while on Windows 10 64-bit (it needs to have run the node for a number of hours to reproduce) I closed bitcoin-qt. The "do not shutdown computer" message stayed up for almost two hours before it finally closed.
I have been experiencing this issue consistently, and this delay has lasted even longer in prior instances (i.e. lasting for many more hours). The delay seems to be proportional to how long bitcoin-qt has been running. See below an example debug.log after closing bitcoin-qt this particular time.
2017-03-16 22:03:23 tor: Thread interrupt 2017-03-16 22:03:23 addcon thread exit 2017-03-16 22:03:23 opencon thread exit 2017-03-16 22:03:23 scheduler thread interrupt 2017-03-16 22:03:23 Shutdown: In progress... 2017-03-16 22:03:23 msghand thread exit 2017-03-16 22:03:23 net thread exit 2017-03-16 23:56:07 torcontrol thread exit 2017-03-16 23:56:14 Dumped mempool: 0.031193s to copy, 6.97686s to dump 2017-03-16 23:56:23 Shutdown: done
Take note of the torcontrol thread not closing until almost 2 hours later. I'm not sure if this is just a coincidence or actually caused by the torcontrol thread taking forever to close, but at least it's a start. I am not running tor, but I realize that, by default, Bitcoin Core now listens for onion routing. I suspect that turning off onion listening would work around this bug (listenonion=0), but I haven't confirmed this yet (would take a while to test). In the meantime, I will let bitcoin-qt run again for a number of hours with listenonion=1 and debug=tor to see if anything more interesting appears in the log after an extended period of time.
For reference, all default settings are being used for this node, except I have maxuploadtarget set to 144.
Other possibly unique variables to consider with this node are:
1.) I happen to have purposely banned a good number of non-Bitcoin Core peers, one by one, manually for a year over the past year. Not sure if this could interfere in any way.
2.) While datadir is set to the default, the actual default directory in Windows is set up as a symbolic link, pointing to a directory on a USB 3.0 external drive. I don't know how this would interfere with closing a torcontrol thread, but I just thought I'd mention it to cover all bases.