close db connection whenever necessary
Merge pull request #1 from bittorrent/close-connection

close db connection whenever necessary