Apply patch from ticket #5458

git-svn-id: https://svn.osgeo.org/gdal/trunk@27283 f0d54148-0727-0410-94bb-9a71ac55c965
ensure GEOS includes come at end of CPPFLAGS, not the start or they may override local GDAL include files.  Also some reformatting for neatness.

git-svn-id: https://svn.osgeo.org/gdal/trunk@27284 f0d54148-0727-0410-94bb-9a71ac55c965
Move mutex from global static to private OGRSXFDatasource member (#5457)

git-svn-id: https://svn.osgeo.org/gdal/trunk@27285 f0d54148-0727-0410-94bb-9a71ac55c965
Initialise mutex handler to NULL

git-svn-id: https://svn.osgeo.org/gdal/trunk@27286 f0d54148-0727-0410-94bb-9a71ac55c965
JPEG: use EXIF overviews if available

git-svn-id: https://svn.osgeo.org/gdal/trunk@27287 f0d54148-0727-0410-94bb-9a71ac55c965