Don't crash during deps log recompaction if there's more than one deps entry.

Part of issue #554.
Make sure that recompaction writes a pristine new depslog.

...even if a prior run of DepsLog::Recompact() exited without cleaning
up, for example due to a crash or because someone added a `return true;`
in the middle of the function while debugging.  Or because someone hits
ctrl-c during deps log recompaction.

No test, because I can't think of a way to trigger this scenario
programmatically.

Part of issue #554.
Merge pull request #555 from nico/depscompactcrash

Don't crash during deps log recompaction if there's more than one deps entry.
Merge pull request #556 from nico/unlink

Make sure that recompaction writes a pristine new depslog.
Introduce a Truncate() function that works on POSIX and Windows.

Hopefully fixes the build on Windows.
Merge pull request #558 from nico/buildfix

Introduce a Truncate() function that works on POSIX and Windows.
Fix Windows build more.
Merge pull request #559 from nico/9_9

Fix Windows build more.