[algorithms][for_each] fix bug with for_each_segment for open geometries:
for_each_segment was not considering the last implicit segment of open
geometries; the patch fixes this;
Merge pull request #147 from mkaravel/fix/for_each

[algorithms][for_each] fix bug with for_each_segment for open geometries