Fix hanging of diagnostics on Windows
Merge pull request #715 from bpindelski/diagnostics_10155

Fix hanging of diagnostics on Windows (see #10155)