Make the tests pass with a newer sqlite

This is really @xeqi's work, I could just reproduce it more easily.