Always add first segment when appending coordinates

When we have only a single point, we want to make sure it gets added (fixes #1821).

Because this code doesn't differentiate coordinates that are part of a linestring or linearring from those that are independent points, we always add the first segment (or pair of points).  In addition, coordinates for segments are appended whenever they represent a change in relationship with respect to the extent.  This keeps the code simpler for handling fills and properly capturing intersection points for linestrings.  This could be modified to save a few extra coordinates, but it provides for simpler code at a very minimal cost.
Fix calculation of ends in ol.geom.MultiPolygon#getPolygons
Merge pull request #1820 from twpayne/fix-multipolygon-get-polygons

Fix calculation of ends in ol.geom.MultiPolygon#getPolygons
Merge pull request #1822 from tschaub/append-first

Always add first segment when appending coordinates.
Update the pointer to the next block when reversing

Just reversing the array is not enough, the pointers to the
beginning of the next block must be changed to the reversed
array index.
Merge pull request #1824 from ahocevar/replay-hit-detection

Iterating through the hit detection replay batch fails when geometryRenderFunction returns false
Merge branch 'official-master'