squashed 2 excellent fixes from Thomas Faber to fight that regression which
started to become visible for me after SVN r73532 == git
6d7fcc4bab
----------------------------
[0.4.7][NTOS:EX] Worker threads must not exit with a critical region held. CORE-13734
cherry picked from commit 0.4.9-dev-146-g
2b8f4f6e24
----------------------------
[0.4.7][WINSRV] Don't try to remove messages from the queue without dispatching them. CORE-13734
This partially reverts r58615 / 01729482ae.
cherry picked from commit 0.4.9-dev-148-g
3159de5573