Don't clear previous infill densities when generating connected lines
The bug was that when connecting infill lines, it clears the previously generated lines to replace them with polylines. The result_lines is an output polygon that contains all infill lines from different infill densities as well if you're using gradual infill. So this clear() would also delete previous infill densities and will not re-fill them with connected lines.
Contributes to issue CURA-5811.