Fix polyline caching in PathVisualizer.

This was a typo/regression from #2223. Also added a test.

Fixes #2250
Merge pull request #2251 from AnalyticalGraphicsInc/issue2250

Fix polyline caching in PathVisualizer.