Close databases when object is no longer needed