We needed the close_all_db function to close any remaining database connections on shutdown. But why were there any unclosed db connections anyway? The connections were closed after the thread was already marked as shut down so when exiting the thread wasn't done with closing the database yet and thus sometimes you had an improper shutdown. Now the threads are only marked as stopped when the database connection is also closed so we have guaranteed that they'll be closed when the server returns. So no more need to explicitly close any remaining afterwards.
When the value of the URL prefix would be changed, if the resulting json would be smaller than the current json, it would create invalid json. Now we wipe the contents before writing to avoid this.
* Added API and UI base for panel
* Added option to disable registration (Fixes#27)
* Added settings for login duration (Resolves#39)
* Added user management and download database button
Some of the waitress code has been overwritten to make this work (at `backend.db.ThreadedTaskDispatcher`). The `handler_thread` function has been changed so that when the thread shuts down, the database connection for the thread is also closed (this _has_ to happen _in the thread that the connection is for/from_). The `shutdown` function opens and closes a database connection at the end, which triggers the checkpoint of the journal, writing everything to the db file and removing the `-wal` and `-shm` temporary db files.