fix SQLite3 race condition in test helper

Don't know why this was that way, but it was definitely wrong.