Prevent duplicate load path entries.

Fixes #1729.