Optimize constructNextName further

Allocating, deallocating, and inserting into a std::set takes almost
twice as long as allocating, deallocating, push_back, sort, and erase
from a vector<>. The result is the same, a container with unique int
values.