The algorithm to merge points based on distance thresholdhas been
implemented in 8b7d5f8587. This patch moves the function to
`blender::ed::greasepencil` namespace and use it to implement
merge by distance operator.
There are two parameters for the operator:
`threshold`: Distance threshold used for merging.
`use_unselected`: Use whole stroke or only selected points
Resolves: #113917
Pull Request: https://projects.blender.org/blender/blender/pulls/120385