Make the PolicyPathParser more reliable on MacOS.

The ${machine_name} variable would sporadically fail to resolve on try
bots. This change make it revert to "localhost" if the actual host name
can not be resolved. This behavior will be also better for customers
rather than leaving the possibly invalid path containing ${machine_name}
verbatim.

BUG=327520
TEST=PolicyPathParserTests.AllPlatformVariables not flaking anymore

Change-Id: I9b931e301ac73703aa7fe7cb7a623daa112ae8c3
Reviewed-on: https://chromium-review.googlesource.com/c/1475490
Reviewed-by: Owen Min <zmin@chromium.org>
Commit-Queue: Julian Pastarmov <pastarmovj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#632618}
2 files changed