Add retry block util and retry cow update

We currently fail sometimes when updating cows, and the issue has always been
resolved by just trying the update again. This commit introduces a utility
method to retry a code block a number of times, which is more flexible than
loop_shell_command which expects a shell command only. The cow update is
wrapped in a block and executed 3 times, failing after the 3rd try without
success. This commit removes the old brittle loop_shell_command method and
replaces calls to it with retry_on_fail.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>