[Bug 2127] New: WriteFile fails on threaded applications