Clean up CMStats code.

Besides the cleanup, make sure to wait a bit between retries if upload fails for whatever reason.

JIRA:CYAN-1187
Change-Id: Ifca8364721007aadef31b328d22d764ef7cb3b0a
Merge "Clean up CMStats code." into cm-10.1
Settings: merge CyanogenMod

Change-Id: Iee0fa02eea6657845c9cff682ce0bec802e8d051