Fix for OsmANd project bug that throws array out of bounds error when editing the waypoints list

These changes are required to support changes in the OsmAnd project IntermediatePointsDialog class to fix the array out of bounds error that occurs under some circumstances when the waypoints list is edited