Fix crash on sync due to collection being closed

[Issue 2328](https://code.google.com/p/ankidroid/issues/detail?id=2328)