[get_turns] Refactor get_turn_info_for_endpoint::handle_segment(), remove unused variables.

The code was moved outside get_turn_info_for_endpoints, to linear_intersections.
The code in the caller is more clear and safer since all variables are initialized and stored in linear_intersections.