Prevent circular reference when single handle
Prevent circular reference when single handle

When using the freehand tool, if you click to create the first handle, then shift click to freehand draw, then end the shape by clicking the origin point, the resulting annotation object will contain a circular reference to the one handle. This occurs when it tries to close the shape by appending the handle object to the same handle's handle.lines array. This fix appends a new object copying just the x, y coordinates of the nearby handle.

The circular reference doesn't cause any problems until you try to serialize the annotations object (i.e. to save to a DB). Both jQuery.extend and JSON.stringify will throw errors.
cornerstonejs/cornerstoneTools,cornerstonejs/cornerstoneTools,leonardorame/cornerstoneTools,cornerstonejs/cornerstoneTools,chafey/cornerstoneTools,google/cornerstoneTools,google/cornerstoneTools,leonardorame/cornerstoneTools