I think this part reads from a memory mapped file (the .wal-shm file index). Might be something there is broken on your system.
It uses an embedded copy of SQLite. If you want to use a different one you need to compile with a non-default configure flag.