Unable to delete sqlite file after connection was closed
Looking at the code for the SQLiteQueueDatabase, I think I need to add some logic in there to close the connection. I'll get a patch up in a minute.
 Note: I can delete the file on linux but not in windows.
 I added the fix for that here: 72c5ea98209241f0fb3e2c1a330644735f803370

Basically, each worker thread needed to be responsible for closing it's own connection, which wasn't happening. This should be fixed now.
 Thank you!
 Although this was a somewhat obscure problem in my case, if I can help only one developer not spend hours on trying to debug this issue... For future reference:

I'm developing a flask app for which I have an automatic reloader enabled which restarts the web app every time a python file is changed (this is not enabled in production, of course). This forked the process (so that it can close the old one and restart it on change) which created a handle on the database file and locked it. That's why it could not be deleted. I started flask with the reloader disabled and voilà, the file could be deleted after closing the database. It worked on my linux test VM because there I have production code running where the reloader is disabled, but I was misled into thinking it could be an OS issue.

I'll need to check how many of my database issues are caused by this because, as you quoted correctly, sqlite connections shouldn't be taken over into forks but I never thought of this reloader and of course I did all my tests with it enabled...

![panda](https://media.giphy.com/media/14aUO0Mf7dWDXW/giphy.gif)

I'm working on a feature that allows restoring data from a backup ZIP. For this I want to replace the existing database file with one from the ZIP. But even after stopping and closing the SqliteQueueDatabase the file is still used by my process. I've tried to write a simple script to reproduce this issue but of course there it works fine. Do you have any ideas what could be the reason that the file is still locked and how to solve that? Thanks.
