Use GEOS reentrant API (_r functions) and update requirement to GEOS >= 3.1.0

Currently QGIS uses the 'classic' GEOS API that uses a global context.
This can conflict with libraries that would also use the global context
and potentially finalize it whereas QGIS will still use it later.

See https://groups.google.com/forum/#!topic/spatialite-users/9YSU6c5AVQ4 for
such an example of such a recent issue with Spatialite.

The _r API is available since GEOS 3.1.0, which is already an ancient GEOS
version. For example, old-old-stable Ubuntu (Lucid 10.04) and Debian (squeeze)
ship with GEOS 3.1.0 or later.

Such move has also been done in GDAL 1.11
(http://lists.osgeo.org/pipermail/gdal-dev/2013-August/036877.html)
and MapServer 7.0 (https://github.com/mapserver/mapserver/issues/4733)

There's no easy way unfortunately to check at compile time that you don't
use the non _r API. I have patched my geos_c.h header to #ifdef that API (quite
painfull to do..). A postprocessing check can be done however with :

objdump -T output/lib/*.so | grep -v Base | grep GEOS | grep -v _r | grep -v "_ZN" | grep -v GEOSversion

It should return nothing.
Merge remote-tracking branch 'rouault/use_geos_reentrant_api'

Conflicts:
	src/core/pal/layer.cpp
	src/core/qgsgeometry.cpp
	src/core/qgspallabeling.cpp
Use _r GEOS API in geometry import test
GEOS context accessor for PAL
Real name of @leyan instead of pseudonym
Merge remote-tracking branch 'origin/master'