Fix race condition on Windows by consolidating two file writes
Merge pull request #20 from RichardBradley/issue-19-windows-race-condition

Fix race condition on Windows by consolidating two file writes