Added some protections in VecTiles against closed DB cursors and bad geometry