fix #2421: crash when resuming c:geo

For some reason, the database seems to have been closed and not reopened
after some inactivity. This should take care of it.