Set output mtime of phony edges to latest inputs

This is a partial cherrypick of https://github.com/ninja-build/ninja/pull/1964/
which fixes a build correctness bug for phony edges. Previously, actions
with implicit dependencies on phony targets would not rerun if the
inputs to these phony targets were changed.

Test: Manually verified bug fix with repro case described in b/232030877#comment27
Test: New unit test
Change-Id: I1d58abb9c46e9a31f0cb3b44bf45e87f8f301209
3 files changed