[algorithms][for_each] Alternative fix

This is a follow up of PR #147 and PR #149.

Fix bug in for_each_segment for open geometries without using the closeable_view (so that mutable geometries can also be supported).