Function to close SQLite connection

I added a ``close`` function, which allows closing a sqlite connection safely.