Switch to lstat for all nodes with input edges

In an Android build, we have a directory that represents the device's
filesystem, with many ninja edges that populate that directory with the
correct contents. Some of those files are actually symlinks:

  .../system/bin/ls -> toybox
  .../system/vendor -> /vendor

These currently cannot be represented in the build graph due to the use
of stat(), which will attempt to follow those symlinks. In the toybox
case, that may actually work as long as `ls` and `toybox` are created by
the same edge, but that's not guaranteed to happen. And for the absolute
links, they'll often be considered missing, or will have stat results
from completely unrelated files.

So we currently don't represent these files in the build graph, making
them side effects of some other file that is actually in the build
graph. That becomes very error prone when the symlink is removed, but
that other file isn't, etc. It's sometimes difficult to find an
appropriate file to attach a side effect to.

What's important is that we never intend to actually walk the symlink we
generate, they're just used as any other file would be by tools like zip
/ image creation tools / etc. So it's safe to always use lstat for
generated files -- aka nodes with input edges.

This doesn't change the behavior for source files -- we're still going
to use Stat, which is appropriate in many cases, since most tools would
just read from the path, getting the final destination file.

There are potential, but rare for Android, issues:

 * If we had set up the build outputs as symlinks, then actually written
   to the destination file, expecting that to be used by dependent
   rules. This shouldn't be the case in the Android build -- none of the
   standard build steps do this, and it should be unusual otherwise too.

 * During one build we create a symlink, then in another build use it
   without the defining rule. With `mm` gone, this should be quite
   unusual (in cases where a full build succeeds). There's a small
   chance it could happen in the ASAN builds, which runs the build
   twice.

Test: built-in tests
Change-Id: I84fb74fc502b45f978ebe03d4b5331d734b52dcc
10 files changed