add fact caching logic for failed lookups

Writes out a cache file on every successful lookup of network_public_ip, uses it if it can't reach the public service for any reason.

Really useful for avoiding inevitable cluster-fuckery with reconfiguring critical parts of infrastructure because an external service was unavailable.