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.
This was a recently detected bug in gdal, which made it incompatible with sqlite 3.8.7
http://trac.osgeo.org/gdal/ticket/5725#comment:14