Fix test project
Prevent access to closed database
Fix Crash on missing SpatialiteLayer handler