Added interupt to DB thread

This speeds up DB shutdown by a great ammount, making tests run alot faster.