Do not abort if cannot open repository sql db.

Do not pass NULL pointer to sqlite transaction rollback code
if a database has not been successfully opened (due to insufficient
permissions for example).