Fix pragma editing and further code clean up

Hi!

These changes fix a bug in the pragma editing. Now it's possible to change the journal mode to WAL - however, changing it back still isn't possible because we'd need to leave transaction mode for this.

I also got rid of the SQLLogDock by integrating it into the MainWindow. This makes the code a bit easier to maintain but it also required quite a bit of restructuring, so you might want to pull this soon to avoid complicated merging.