refactor to initialize syncdb in just one place

this allows also to use in-menory sqlcipher databases
for tests.