fixed segfault when opening a SQLite database fails