Initial code to run NVDA's core pump only when necessary, rather than having it run on a continual timer.

So far, IAccessibleHandler and queueHandler.queueFunction (which is used in many places such as eventHandler and scriptHandler) request a core pump.
queueHandler generators and other handlers need to do this as well.
watchdog: Only wake up if action might actually be required rather than checking using a continual timer.

A waitable timer is used to achieve this. When the core reports as alive, the timer is set so that the watcher will wake if the timer isn't reset or cancelled.
Also, the core pump reports that it is going to sleep at the end of the pump, which cancels the timer. This is necessary because the core doesn't spin any more, so if it isn't doing anything, it won't report as alive.
core.requestPump: Use a time of 10 ms, which seems more reasonable than 1 ms and is the lowest SetTimer will go anyway.
JABHandler: Request a core pump when required.
touchHandler: Add to the core pump and only request a core pump when needed rather than spinning a queueHandler generator.
If there are queueHandler generators, continaully request pumps (spin) so they are executed.

This means that we do spin when there are generators. Ideally, these shouldn't be used, but say all, speak spelling, etc. need some huge refactor before that is possible. At least this way, we only spin when those are active, which is a very specific user request.
core: Clean up stuff related to the pump a bit.
Python console: Notify the watchdog that the core is alive before executing something so that it can act if a command freezes for too long.
Fix an issue where when opening a message in Outlook Express, the message sometimes wouldn't get focused in NVDA until after a key was pressed, causing apparent double speaking in some cases.

Wx timers aren't re-entrant, so if a modal loop runs, the timer just gets ignored. Unfortunately, sending a key press causes a modal loop, so the pump request for the focus event was sometimes being swallowed.
Now, before it exits, the pump checks whether there is a pending request but a pump isn't scheduled. If this occurs, it schedules another one.
Re #3803.
Fix delay in mouse tracking.

The mouse hook now requests a core pump when the mouse moves.
Re #3816.
Touch support: ensure to request a core pump after an appropriate interval to emit timeout multiTouch trackers (e.g. double tap).
Notify watchdog appropriately when executing a delayed IAccessibleHandler call to correct the focus.

Previously, the watchdog didn't know about these calls, so they weren't subject to possible cancellation. This resulted in unrecovered freezes, for example, when alt+tabbing to an unresponsive process.
core.callLater was introduced to facilitate this. It should be used instead of wx.CallLater for any delayed calls which aren't just for UI.
core.requestPump: request the main thread to start the pump timer rather than the calling thread, by using a wx.CallAfter. Re #3801, #3863

WX does not support starting a timer from outside the main thread. This was possibly working some how, but was throwing assertions, and in some caces perhaps was the cause of #3863 - WX was calling DebugBreak.
Added an option to keyboard settings dialog which allows to disable handling of key input from other applications. Users typing Vietnamese using Unikey should turn this option off.
core.requestPump: optimisation: If called in the main thread, don't bother using CallAfter to start the timer, as this is only needed for other threads.
watchdog: Use core.mainThreadId.
Merge branch 'master' into t3801
MSHTML VBufBackend: only skip text nodes if the parent node is hidden due to style, not role="presentation".
Don't announce the document itself when entering a browse mode document after the first time, when coming up from a non-rendered descendant. Still announce when coming in from the outside of the subtree.
Reduce spinning in NVDA core and watchdog.

Fixes #3801.