Fix memory errors

After https://github.com/openstreetmap/osm2pgsql/commit/d1b6c5e563e8eb9d836d97fad094f0a1b35f92ea#diff-a4a10b448709d2cc5dc0c85fb36a2b1c
the RAM cache size can be zero, but ``am_cache_nodes_set_sparse`` often accesses ``sparseBlock[0]``. It gives serious memory access erros and failures during testing (detected with Intel Inspector XE when fixing Windows builds https://github.com/openstreetmap/osm2pgsql/issues/17 ).

I am not sure the proposed fix is the best solution, but something should be done with this error.
constrain geometry check to way column

When more than one geometry column exists in a table, the sanity check
was failing when running osm2pgsql in append mode. This constrains the
number of rows and srid check to the way column specifically.
Trim down README and move more detailed information into docs directory
Add a file explaining how to do basic geospatial analysis with osm2pgsql

Based on an unpublished blog post I never finished off
Add a paragraph on exporting from an osm2pgsql db

osm2pgsql can be part of a useful toolchain for generating shapefiles,
but little is documented about this, so this adds a basic paragraph.
Add some documentation on the pgsql backend
Add a lengthy document on osm2pgsql usage

osm2pgsql has a *lot* of command-line options
Add a (very) basic file on gazetteer
Support alt_name_* tags in output-gazetteer
Merge pull request #179 from pnorman/docs

Readme and docs rewrite
Merge pull request #176 from rmarianski/constrain-geometry-check

constrain geometry check to way column
Merge pull request #175 from alex85k/patch-1

Fix memory errors
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.