Only add one instance of a file to the need list (fixes #592)