Add test that proves `node->AddOutEdge(edge);` in `LoadDepFile()` is needed.

No functionality change. Related to issue #590.
Merge pull request #592 from nico/addtest

Add test that proves `node->AddOutEdge(edge);` in `LoadDepFile()` is nee...
Add a test for CreatePhonyInEdge() in depsmode path.

Removing the `CreatePhonyInEdge(node);` line in
`ImplicitDepLoader::LoadDepsFromLog()` made no tests fail before this change.
The new test is a port to depsmode of the existing DepFileOK test.
Merge pull request #593 from nico/moretest

Add a test for CreatePhonyInEdge() in depsmode path.
Make sure to not write partial deps entries.

When two ninja instances run in parallel in the same build directory,
one instance could write a deps entry header and a few ids, and then the
other instance could write a file name in the middle of the deps header.
When ninja reads this deps log on the next run, it will deserialize the
file name as indices, which will cause an out-of-bounds read.

(This can happen if a user runs a "compile this file" that uses ninja to
compile the current buffer in an editor, and also does a full build in a
terminal at the same time for example.)

While running two ninja instances in parallel in the same build
directory isn't a good idea, it happens to mostly work in non-deps mode:
There's redundant edge execution, but nothing crashes. This is partially
because the command log is line-buffered and a single log entry only
consists of a single line.

This change makes sure that deps entries are always written in one go,
like command log entries currently are. Running two ninja binaries in
parallel on the same build directory still isn't a great idea, but it's
less likely to lead to crashes.

See issue #595.
Merge pull request #596 from nico/chunk

Make sure to not write partial deps entries.
Add stdlib.h include for atol().

This attempts to fix issue #600. `man atol` claims that atol() is in
stdlib.h, which wasn't included yet.
Merge pull request #601 from nico/109fix

Add stdlib.h include for atol().
support Bitrig
cleanup based on comments from martine
ugh, missing #
Exclude Windows as well
Adding error checking on fwrite/fflush in deps_log
use !defined(NOT_PPOLL)
Adding checks for record overflow in deps_log
Merge pull request #607 from dajohi/master

Support Bitrig
Use fwrite to print whatever the subcommand wrote

Subcommands can write things like UTF-16, which some terminals can
understand.  printf() will interpret the null bytes as the end of the
string.

In particular, MSVC's assert() will print wide characters by default,
and I can't find a way to disable it, leading to clang assertion
failures looking like:
  FAILED: ...clang.exe ...
  Aninja: build stopped: subcommand failed.

With this fix, I get the desired:
  FAILED: ...clang.exe ...
  Assertion failed: SymbolMap...
  ninja: build stopped: subcommand failed.
Merge pull request #610 from rnk/wstr

Use fwrite to print whatever the subcommand wrote
Improve error message for duplicate rules and unknown pools.

Also add more tests for invalid manifests. According to gcov, these invalid
inputs weren't tested before.
Mention pools in the discussion of ninja's toplevel declarations.