Backport SQLite3 fixes to Akavache 2.x

This backports #66 to Akavache 2.x