Simplify ImageColors::generatePalette initial loop to fix crash
tempSamples is meant to work like a pseudo thread local storage, before pushing everything together.
On my system omp_get_thread_num always returned 0 despite running in different threads. We then crash on multiple access to the same list.
Maybe that's an upstream bug, but in either case we can reduce some allocations, complexity and copying by locking round the insertion.