(PUP-3379) Bring back retry action

Commit 4f1ff7d removed the inventory service code, and since that was
the only consumer of Puppet::Util::RetryAction, it was removed too.

But we have other cases where that behavior would useful, so this
commit adds it back, with some improvements.