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.
added missing windows include
Merge pull request #562 from TheOneRing/fixed-include

added missing windows include for Truncate
share platform support between configure/bootstrap
Move some DepsLog::Deps initialization code into its constructor.

No functionality change.
Move updating DepsLog's deps_ array into its own function.

No functionality change.
Let DepsLog::RecordDeps() update its in-memory representation.

This is a behavior change, but it should be safe: Graph only queries the
deps log at startup, before running any command. Nothing else currently
queries the deps log.
Keep a DepsLog's data valid after a call to DepsLog::Recompact().

Previously, a DepsLog would become invalid after Recompact() was called,
due to Recompact() making all node ids refer to a temporary DepsLog
object constructed in Recompact().
Recompact the deps log when it gets too big.

Now that Recompact() keeps all data structures intact, it can just be
called at the beginning of a build and the build will still work.
Add support for OpenBSD.

Use ppoll() on OpenBSD.  Also, fix interrupt handling to recognize
that on FreeBSD and OpenBSD, an interrupt might have been delivered
even if pselect()/ppoll() don't return -1/EINTR.
Merge pull request #563 from nico/recompact-deps

Implement deps log recompaction.
minor formatting change
Merge pull request #566 from nico/tweak

minor formatting change