Make Juju retry apt-get commands.

https://bugs.launchpad.net/juju-core/+bug/1354685

This makes Juju retry apt-get commands. It uses the same back off algorithm as found in charm-helpers. Namely sleep 1s between a maximum of 30 attempts.
I'd add a couple more lines testing other types of errors that might happen (i.e. cmdError = fmt.Errorf("foo") or something, to make sure the suggested if clauses above indeed catch such unexpected errors).