Enable sqlite WAL to try to solve database locked problems.

There are several tickets involving crashes due to the database being locked. My theory is that it's when multiple threads are accessing the database at once. Hopefully enabling write ahead logging on the sqlite database will solve this. I'd like a little bit of testing for this change to see if it actually helps or causes any problems before I merge it in though. If anyone is getting errors like this:

`OperationalError: (OperationalError) database is locked`

If a few people could test this branch and give feedback it would be much appreciated.