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.
Merge pull request #175 from alex85k/patch-1

Fix memory errors