fix Issue 11009 - Regression (2.064 git-head): DMD consumes huge memory ...

...when it compiles enum containing many items

http://d.puremagic.com/issues/show_bug.cgi?id=11009

This is a fixup of pull #1540.

Turns out NoDuplicates is scary inefficient for large input.

This cleans up and simplifies the pull somewhat.