Spatial libraries fixed

When building [libosmium](https://github.com/osmcode/libosmium) examples under MSYS2 I noticed some bugs in newly added spatial packages (libspatialite, gdal and geos). Th edetailed descriptions are in comments.
Testing is rather fast and passes without problems.