When using the Freeform Pen tool with the Magnetic Option checked in the Options bar, double-click to close the Path. Add the Option (Mac)/ Alt (Win) to close the path with straight-line segment.