AU: Ensure update_engine_client get proxy retries are spaced out in time.

Hopefully, this will reduce test flakyness. It seems that last time the test
failed all 4 tries happened within a one-second timeframe.

Also, fix GError object memory leaks throughout the code.

BUG=chromium-os:21351
TEST=unit tests, tested on VM

Change-Id: If0bc5d5767d12f3396d0fcb46f3e04ed6d7dfd5c
Reviewed-on: http://gerrit.chromium.org/gerrit/8862
Commit-Ready: Darin Petkov <petkov@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
diff --git a/utils.h b/utils.h
index 7b39cd4..b0b28a8 100644
--- a/utils.h
+++ b/utils.h
@@ -142,8 +142,9 @@
 // param. Returns true on success.
 bool GetBootloader(BootLoader* out_bootloader);
 
-// Returns the error message, if any, from a GError pointer.
-const char* GetGErrorMessage(const GError* error);
+// Returns the error message, if any, from a GError pointer. Frees the GError
+// object and resets error to NULL.
+std::string GetAndFreeGError(GError** error);
 
 // Initiates a system reboot. Returns true on success, false otherwise.
 bool Reboot();