Improve external locking on Windows
Improve external locking on Windows

commit 2c15248 improved external locking for POSIX.
See that commit for advantages of the technique used.
This implements the same technique for Windows systems.

Fixes bug: 1033596
Change-Id: I298309bb1c84499f2060c172213d355aa7ce54e5

n0ano/gantt,n0ano/gantt