[sqlite] improve performance of sqlite generation by proper PRAGMA

Also, force WAL checkpoint at the end, otherwise the DB might be incomplete.
4 jobs for 362-dev-sqlite-performance-improvement in 42 minutes and 33 seconds (queued for 5 seconds)
latest
Status Job ID Name Coverage
  Cabal
passed #18836
cabal

00:20:05

 
  Stack
passed #18837
stack

00:02:54

 
  Bench
manual #18838
allowed to fail manual
bench
 
  Test
passed #18839
test

00:19:33