title: python closing db in cog file says its still running, error
body: <p>Our discord bot uses sqlit3 to retrieve data, but sometimes due to traffic or error get db locked.
  Inorder to fix this we have to copy and paste so i made a function to copy paste adn delete all old file
  .BUt even after closing connection its says the db is still opened,</p>
  <pre><code>def db_lock():
          
          discord.close()
          base_directory = os.getcwd().replace(os.sep , '/')
          original = base_directory+'/discord.db'
          new_file = base_directory+'/discord_locked.db'
          os.rename(original, new_file)
          shutil.copyfile(new_file, orginal)
  </code></pre>