Make sure to close all database objects and geopackage objects

I am working on getting GeoPackage support for GeoScript and ran into locked tables when writing and then immediately reading.  Being careful to close all database objects (ResultSets, Statements, and Connections) fixed the problem.  This fixes JIRA issue #GEOT-4701.