use mkstemp() for database file name.
test reopening existing database