[PATCH 2/5] location-functions.pl: Add END block to release the database handle.