Factor out the on_failure to a mixin type

To allow for failures to be handled in different
ways extract out the on_failure definition of a
retry object to allow it to be its own mixin or
base class for resolvers that can only provide a
on_failure method.

Change-Id: Ief422bb57316b913897ca65496144edcfdd1a948
Merge "Factor out the on_failure to a mixin type"