Fix #101 part 2: keep sqlite queries in their own threads