Mbtiles/geopkg: remove duplicated abstract class + fix various bugs