bz19963: avoid crash on QuerySyncInfo when our device DB is closed

Moved the code to handle QuerySyncInfo() from the backend message
handler to DeviceSyncManager.
Fix for converting old device databases and the json module