Add close to all sqlite statements
Should fix the transaction in progress and locked errors