Close ballot box databases on destruction

Hopefully this fixes a lot of the missing data issues in the ballot box.