Fixed crash that sometimes happened at shutdown
bz19509: fix item rendering for items that we will retry.

Added code to render the items correctly.

Moved code to update the "retrying in..." label from the backend to
the frontend.
bz19509: Consider DNS lookup errors "temporary" and retry the download
bz19858: Fix handling device sync info.

Changed the backend to use work with the sqlite device database
instead of the JSON one.

Removed check for max_sync_size from the frontend code.  Having the
frontend access the device database has threading issues and the
backend uses the calculated max sync size anyways.  It seems best to
just have the frontend trust the backend.
Unittest fixes.

Change things so that if we get an error fetching the initial list, we
don't create an ItemFetcher.  It's not necessary and with the new
code, ItemFetcher makes a database query, so the constructor will
probably throw another exception.