add function to build multiline geoms from relations

needed for waterways in gazetteer output,
fixes https://github.com/twain47/Nominatim/issues/133
Fork not supported on MinGW.
Added additional logic to properly detect mingw. More udpates for supporting custom protobuf-c paths. Mthread support detection updates.
MinGW also requires GEOS_INLINE.
Updates to support custom protobuf-c paths on mingw. Old logic was self sabotaging itself by resetting includes to nothing when the inc/lib specific flags were specified to configure.
Not sure why __MINGW_H macro is used. __MINGW32__ or __MINGW__ are the standard widely used macros. I couldn't get osm2psql to build with the _H macro. I went forward using _MINGW32__, which is what you see in most open source ports to this platform.
Moved config.h header down the headers list so the VERSION and PACKAGE_VERSION macros wouldn't interfere with osm2pgsqls.
Revert pthread updates.
Make sure any protobuf-c dependencies are included after.
removed extra bracket on cygwin macro.
added mingw package script.