geopackage driver improvements

    - Fixing issues with encoding
    - Support for reliable fids with primary key

partially ported from jeo/jeo@dde6494d